Reputation: 197
I would like to exlude some terms a user may enter into the search bar as they bloat the results.
For separate reasons I need the operator: :or
, but if I have a search term like "The Beatles" it searches the whole database for "The" and "Beatles" which is way too many results. I would like to exclude "the" from any query received, so it would be as if the user had only searched "Beatles".
Maybe this isn't possilbe. Thanks for the help 🙏
I tried to add exclude: ["the"]
, but this removed any ressults which had the term "the".
Upvotes: 0
Views: 329
Reputation: 1075
Elasticsearch have great solution fro solving such questions - analyzers.
In your case you need to implement Stop analyser in your mapping. Details and docs can be found here: Stop Analyzer
Upvotes: 0