Stop Words Overview
Stop words are very common words in a given language. In English, these would be words like the, and, at, with and as. By default, the engine does not remove stop words.
Removing Stop Words
The removeStopWords parameter can be used to remove stop words from the query before executing a search:
"what is a record" ➡️ "record"
The parameter’s value can be one of:
- a boolean:
false, enable or disable stop words for all supported languages
- an array: a list of language ISO codes for which stop word removal should be enabled. For example,
["en", "es"]would remove stop words in English and Spanish.
Setting removeStopWords to an array value is recommended, because using simply true can lead to false positives.
The behavior of removeStopWords also depends on the queryType parameter:
queryType = prefixLast: the query’s last word is treated as a prefix, and won’t be considered for stop word removal
queryType = prefixNoneno query word is treated as a prefix, so every query word is considered for stop word removal
queryType = prefixAll: all query words are treated as prefixes; no stop words will be removed
Stop word removal is supported in the following languages, with their associated ISO codes:
no, Persian (Farsi)=
When to Use Stop Words
In specific cases, removeStopWords can be helpful in removing false positives from search results, especially when combined with optionalWords and removeWordsIfNoResults. However, for most use cases, we don’t recommend enabling it, as users already tend to naturally omit stop words in their queries.
Continue building your Algolia knowledge with these concepts:
Did you find this page helpful?
We're always looking for advice to help improve our documentation!
Please let us know what's working (or what's not!).
We're constantly iterating thanks to the feedback we receive.