Stop-words
The stop-words route lets you add a list of words that will be ignored in search queries. So if you add the
as a stop word and you make a search on the mask
you will only have matching documents with mask
.
Stop-words can also be updated directly through the global settings route along with the other settings.
To learn more about stop words, refer to our .
WARNING
Updating the settings means overwriting the default settings of MeiliSearch. You can reset to default values using the DELETE
routes.
GET
Get the stop-words list of an index.
Path variables
<>
cURL
JS
Python
PHP
Java
Ruby
Go
Rust
Dart
curl \
-X GET 'http://localhost:7700/indexes/movies/settings/stop-words'
client.index('movies').getStopWords()
client.index('movies').get_stop_words()
$client->index('movies')->getStopWords();
client.index("movies").getStopWords();
client.index('movies').stop_words
client.Index("movies").GetStopWords()
let stop_words: Vec<String> = movies.get_stop_words().await.unwrap();
client.index("movies").getStopWords { (result: Result<[String], Swift.Error>) in
switch result {
case .success(let stopWords):
case .failure(let error):
print(error)
}
}
await client.index('movies').getStopWords();
Response: 200 Ok
[
"the",
"to"
]
POST
Update the list of of an index.
Path variables
Body
An array of strings that contains the stop-words.
If a list of stop-words already exists it will be overwritten (replaced).
.
<>
cURL
JS
Python
PHP
Java
Ruby
Go
Rust
Swift
curl \
-X POST 'http://localhost:7700/indexes/movies/settings/stop-words' \
-H 'Content-Type: application/json' \
--data-binary '["the", "of", "to"]'
client.index('movies').updateStopWords(['of', 'the', 'to'])
client.index('movies').update_stop_words(['of', 'the', 'to'])
$client->index('movies')->updateStopWords(['the', 'of', 'to']);
Settings settings = new Settings();
settings.setStopWords(new String[] {"of", "the", "to"});
client.index("movies").updateSettings(settings);
client.index('movies').update_stop_words(['of', 'the', 'to'])
stopWords := []string{"of", "the", "to"}
client.Index("movies").UpdateStopWords(&stopWords)
let stop_words = ["of", "the", "to"];
let progress: Progress = movies.set_stop_words(&stop_words).await.unwrap();
let stopWords: [String] = ["of", "the", "to"]
switch result {
case .success(let update):
print(update)
case .failure(let error):
print(error)
}
await client.index('movies').update_stop_words(['of', 'the', 'to']);
Response: 202 Accepted
{ "updateId": 1 }
This updateId
allows you to .
DELETE
Reset the list of stop-words of an index to its default value.
Default value
Empty array: []
Path variables
<>
cURL
JS
Python
PHP
Java
Ruby
Go
Rust
Swift
Dart
curl \
-X DELETE 'http://localhost:7700/indexes/movies/settings/stop-words'
client.index('movies').resetStopWords()
client.index('movies').reset_stop_words()
$client->index('movies')->resetStopWords();
//Not yet implemented
client.index('movies').reset_stop_words
client.Index("movies").ResetStopWords()
let progress: Progress = movies.reset_stop_words().await.unwrap();
client.index("movies").resetStopWords { (result: Result<Update, Swift.Error>) in
switch result {
case .success(let update):
print(update)
case .failure(let error):
print(error)
}
}
Response: 202 Accepted
{ "updateId": 1 }
This updateId
allows you to track the current update.