Search code examples
elasticsearch

Queries vs. Filters


I can't see any description of when I should use a query or a filter or some combination of the two. What is the difference between them? Can anyone please explain?


Solution

  • The difference is simple: filters are cached and don't influence the score, therefore faster than queries. Have a look here too. Let's say a query is usually something that the users type and pretty much unpredictable, while filters help users narrowing down the search results , for example using facets.