Stopwords
A stopword is a commonly used word that is often ignored when performing a search. These words occur frequently and typically do not contribute meaningful context to a search query so they are often removed to improve search relevance. Searchcraft comes with multiple, language-specific pre-built dictionaries that pilots may utilize or you can create and manage your own. If you are a Searchcraft Cloud customer, these are managed through the Vektron UI. For self-hosted customers, these are managed via the API.
API Endpoints
GET /index/:index/stopwords
Returns the stopwords for an index.POST /index/:index/stopwords
Add stopwords to an index.DELETE /index/:index/stopwords
Delete an array of stopwords from an index.DELETE /index/:index/stopwords/all
Delete all stopwords from an index.- No payload is required.
Stopwords will only be applied to queries if they are enabled on the schema definition.
Note that if you are using the default dictionaries, the POST and DELETE operations will have no effect, you may only enable/disable stopwords. The delete operations only take effect if you have added a custom set of stopwords.
Auth Requirement
Requires an authentication key that has ingestion permissions.
Request Examples
Add Stopwords
POST /index/:index/stopwords
expects an array with one to many stopwords.
curl -X POST -H "Content-Type: application/json" -H "Authorization: read-key-value" --data '["totallyuniquestopword", "totallyuniquestopword2"]' https://searchcraft-cluster-url/index/:index/stopwords
Delete An Array of Stopword Values
curl -X DELETE -H "Content-Type: application/json" -H "Authorization: read-key-value" --data '["totallyuniquestopword", "totallyuniquestopword2"]' https://searchcraft-cluster-url/index/:index/stopwords
English Examples of Stop Words
- Articles: the, a, an
- Conjunctions: and, or, but
- Prepositions: in, on, at, to, with
- Pronouns: he, she, it, they
Available Stopword Dictionaries
Searchcraft currently supports stopword dictionaries for the following languages. More will be added over time.
Language | code |
---|---|
Arabic | ar |
Chinese | zh |
Danish | da |
Dutch | nl |
English | en |
Finnish | fi |
French | fr |
German | de |
Greek | el |
Hebrew | he |
Italian | it |
Norwegian | no |
Portuguese | pt |
Romanian | ro |
Russian | ru |
Spanish | es |
Swedish | sv |
Tamil | ta |
Turkish | tr |
If stop word stripping is enabled and a language was not set, Searchcraft will default to the English stopword dictionary.