Menu

Vietnamese search in Elasticsearch: diacritics, n-grams and filter order
📰

Vietnamese search in Elasticsearch: diacritics, n-grams and filter order

DEV Community: elasticsearch·Mike Vu·1 day ago
#h8wmi3pO
#devtoelasticsearch#devto#dev#index#filter
Long article (1521 words) — no AI summary yet.
Reading 0:00
15s threshold

Vietnamese users type searches every which way: with diacritics, without them, half a word, part of a device code. A search box has to understand that "may sieu am" means "Máy siêu âm" (ultrasound machine), and that "SAMS" is part of the code "SA-SAMSUNG".

This post walks through the Elasticsearch setup for the equipment inventory in my hospital procurement system : analyzers, the query, deep pagination, rebuilding the index, and a filter-order mistake I only caught while reviewing the config for this post.

Removing diacritics with asciifolding

The asciifolding filter turns accented characters into ASCII: "Máy siêu âm" becomes may , sieu , am . It handles đ too, which becomes d .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.