What is a filter in Elasticsearch queries used for?

What is a filter in Elasticsearch queries used for?

a) To sort query results
b) To exclude certain documents from search results without affecting the score
c) To modify the ranking of search results
d) To remove duplicate documents

Answer:

b) To exclude certain documents from search results without affecting the score

Explanation:

Filters in Elasticsearch are used to exclude documents from search results without calculating a relevance score, making them more efficient for certain types of queries.

Reference:

Elasticsearch Quiz – MCQ Questions and Answers

Scroll to Top