0

By default if I search say 'fast red car' in Algolia, it will return results that has all 'fast red car' words on it. I want results to include data even if it has only has 'red', 'car' or 'fast' on it. Anybody knows how to set it up?

Dagulo
  • 1
  • 1

1 Answers1

0

You can set removeWordsIfNoResults Algolia setting to allOptional. Then all query words will be considered as optional and results will be returned even when some of the words are missing.

Depending on your use case I'd recommend you to consider not using allOptional but one of other options lastWords or firstWords as it might result in better relevance.

Documentation of removeWordsIfNoResults option: https://www.algolia.com/doc/api-client/php/parameters#removewordsifnoresults

Jan Petr
  • 685
  • 5
  • 11