removeStopWords

Type: boolean | list of strings
Engine default: false
Parameter syntax
'removeStopWords' => true|false|['language ISO code', ...]
Parameter syntax
removeStopWords: true|false|['language ISO code', ...]
Parameter syntax
removeStopWords: true|false|['language ISO code', ...]
Parameter syntax
'removeStopWords': True|False|['language ISO code', ...]
Parameter syntax
"removeStopWords": true|false|["language ISO code", "..."]
Parameter syntax
new JSONObject()
  .put("removeStopWords", true|false)
                          new JSONArray()
                            .put("language ISO code")
                            .put("...")
Parameter syntax
dynamic settings = new JObject();
settings.removeStopWords = true|false|new JArray()
                                        .put("language ISO code")
                                        .put("...");
Parameter syntax
.setRemoveStopWords(true|false|Arrays.asList("language ISO code", "..."))
Parameter syntax
"removeStopWords": true|false|[]string{ "language ISO code", "..." }
Parameter syntax
removeStopWords = Some(true|false)
                  Some(IgnorePlurals.list(Seq(
                    "language ISO code",
                    "..."
                  )))

Can be used in these methods:
search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, set_settings, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey search, set_settings, browse, search_for_facet_values, generate_secured_api_key, add_api_key, update_api_key search, setSettings, browse, searchForFacetValues searchAsync, setSettingsAsync, browseAsync, searchForFacetValues Search, SetSettings, Browse, SearchForFacetValues, GenerateSecuredApiKey, AddApiKey, UpdateApiKey Search, setSettings, browse, searchForFacetValues, generateSecuredApiKey, addApiKey, updateApiKey Search, SetSettings, Browse, SearchForFacetValues, GenerateSecuredAPIKey, AddAPIKey, UpdateAPIKey search, changeSettings, browse index, search into facet values, generateSecuredApiKey, add key, update key

About this parameter

Remove stop (common) words from the query before executing it.

Stop word removal is useful when you have a query in natural language, e.g. “what is a record?”. In that case, the engine will remove “what”, “is”, and “a” before executing the query, and therefore just search for “record”. This will remove false positives caused by stop words, especially when combined with optional words (see optionalWords and removeWordsIfNoResults).


Usage notes:
  • For most use cases, however, it is better not to use this feature, as people tend to search by keywords on search engines (i.e. they naturally omit stop words).

  • This setting may be:

    • a boolean: enable or disable stop words for all supported languages; or
    • a list of language ISO codes for which stop word removal should be enabled.
  • Prefix logic: Stop words only apply on query words that are not interpreted as prefixes. To control how prefixes are interpreted, check out queryType.

  • List of supported languages with their associated ISO code:

    Arabic=ar
    Armenian=hy
    Basque=eu
    Bengali=bn
    Brazilian=pt-br
    Bulgarian=bg
    Catalan=ca
    Chinese=zh
    Czech=cs
    Danish=da
    Dutch=nl
    English=en
    Finnish=fi
    French=fr
    Galician=gl
    German=de
    Greek=el
    Hindi=hi
    Hungarian=hu
    Indonesian=id
    Irish=ga
    Italian=it
    Japanese=ja
    Korean=ko
    Kurdish=ku
    Latvian=lv
    Lithuanian=lt
    Marathi=mr
    Norwegian=no
    Persian (Farsi)=fa
    Polish=pl
    Portugese=pt
    Romanian=ro
    Russian=ru
    Slovak=sk
    Spanish=es
    Swedish=sv
    Thai=th
    Turkish=tr
    Ukranian=uk
    Urdu=ur

Examples

Remove stop words for some languages by default

<?php
$index->setSettings([
  'removeStopWords' => [
    'en',
    'fr'
  ]
]);
index.set_settings({
  removeStopWords: [
    en', 'fr'
  ]
})
index.setSettings({
  removeStopWords: [
    'en',
    'fr'
  ]
});
index.set_settings({
  'removeStopWords': ['en', 'fr']
})
index.setSettings([
  "removeStopWords": ["en", "fr"]
])
index.setSettings(
  new JSONObject()
    .put(
      "removeStopWords",
      new JSONArray()
        .put("en")
        .put("fr")
    )
);
dynamic settings = new JObject();
settings.removeStopWords = new JArray()
                              .put("en")
                              .put("fr");
index.SetSettings(settings);
index.setSettings(
  new IndexSettings()
    .setRemoveStopWords(
      RemoveStopWords.of(
        Arrays.asList("en", "fr")
      )
    )
);
res, err := index.SetSettings(algoliasearch.Map{
  "removeStopWords": []string{
    "en",
    "fr",
  },
})
client.execute {
  changeSettings of "myIndex" `with` IndexSettings(
    removeStopWords = Some(RemoveStopWords.list(Seq("en", "fr"))
  )
}
<?php
$results = $index->search('query', [
  'removeStopWords' => ['en', 'fr']
]);
results = index.search('query', {
  removeStopWords: ['en', 'fr']
})
index.search({
  query: 'query',
  removeStopWords: ['en', 'fr']
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
  'removeStopWords': ['en', 'fr']
})
let query = Query(query: "query")
query.removeStopWords = .selected(["en", "fr"])

index.search(query, completionHandler: { (res, error) in
  print(res)
})
index.search(
  new Query("query")
    .setRemoveStopWords(
      "en, fr"
    )
);
index.search(
  new Query("query")
    .EnableRemoveStopWords(
      new EnabledRemoveStopWordsList {
        Enabled = "en,fr"
      }
    )
);
index.search(
  new Query("query")
    .setRemoveStopWords(
      RemoveStopWords.of(
        Arrays.asList(
          "en",
          "fr"
        )
      )
    )
);
res, err := index.Search(query, algoliasearch.Map{
  "removeStopWords": []string{
    "en",
    "fr",
  },
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    removeStopWords = Some(RemoveStopWords.list(Seq("en", "fr")))
  )
}

Remove stop words for all languages by default

<?php
$index->setSettings([
  'removeStopWords' => true
]);
index.set_settings({
  removeStopWords: true
})
index.setSettings({
  removeStopWords: true
});
index.set_settings({
  'removeStopWords': True
})
index.setSettings([
  "removeStopWords": true
])
index.setSettings(
  new JSONObject()
    .put("removeStopWords", true)
);
dynamic settings = new JObject();
settings.removeStopWords = true;

index.SetSettings(true);
index.setSettings(
  new IndexSettings()
    .setRemoveStopWords(
      RemoveStopWords.of(true)
    )
);
res, err := index.SetSettings(algoliasearch.Map{
  "removeStopWords": true,
})
client.execute {
  changeSettings of "myIndex" `with` IndexSettings(
    removeStopWords = Some(RemoveStopWords.`true`)
  )
}
<?php
$results = $index->search('query', [
  'removeStopWords' => true
]);
results = index.search('query', {
  removeStopWords: true
})
index.search({
  query: 'query',
  removeStopWords: true
}).then(res => {
  // console.log(res);
});
results = index.search('query', {
  'removeStopWords': True
})
let query = Query(query: "query")
query.removeStopWords = .all(true)

index.search(query, completionHandler: { (res, error) in
  print(res)
})
index.search(
  new Query("query")
    .setRemoveStopWords(true)
);
index.search(
  new Query("query")
    .EnableRemoveStopWords(
      new EnabledRemoveStopWordsBool {
        Enabled = true
      }
    )
);
index.search(
  new Query(query)
    .setRemoveStopWords(
      RemoveStopWords.of(true)
    )
);
res, err := index.Search(query, algoliasearch.Map{
  "removeStopWords": true,
})
client.execute {
  search into "myIndex" query Query(
    query = Some("query"),
    removeStopWords = Some(RemoveStopWords.`true`)
  )
}
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala
Php small white
PHP
Ruby small white
Ruby
Javascript small white
JavaScript
Python small white
Python
Swift small white
iOS
Android small white
Android
Csharp small white
C#
Java small white
Java
Go small white
Go
Scala small white
Scala