Why configure stop words
Without stop words, a search forthe lord of the rings treats every word equally. The words “the” and “of” match nearly every document, diluting the relevancy of the more meaningful terms “lord” and “rings”. By marking “the” and “of” as stop words, Meilisearch focuses on the terms that actually matter.
Stop words also improve search performance. Since these common words appear in many documents, ignoring them reduces the number of comparisons Meilisearch needs to make during each query.
Check current stop words
Retrieve the current stop words for an index:[], meaning no stop words are configured.
Update stop words
Set a list of stop words for an index. Here is an example with common English stop words:Common English stop words
Here is a more comprehensive list you can use as a starting point for English-language datasets:Important considerations
- Stop words are index-specific. Each index has its own stop word list. If you have multiple indexes with different languages, configure appropriate stop words for each one.
- Stop words are case-insensitive. Adding
"The"is equivalent to adding"the". - Stop words affect indexing. Meilisearch removes stop words from the index, so changing this setting requires re-indexing.
Reset stop words
Remove all stop words and return to the default behavior:Effect on phrase search
Stop words are also ignored inside phrase searches. If “the” is a stop word, searching for"the great gatsby" effectively matches the same documents as searching for "great gatsby", because “the” is removed from the query.
For the full API reference, see get stop words.