how elasticsearch exclude a specific value?

What are some examples of using regular expressions to exclude a document from results in ElasticSearch?

  • For example, I want to exclude from results all documents that contain the word/name Dick. Let's say that I'm writing "SafeSearch" clone.

  • Answer:

    You will need to use a pre query filter with a negative boolean operator and then use the main search query. in SearchBlox we use a filter parameter &filter=-word to do a safe search.

Timo Selvaraj at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.