Filter your results based on a date range

With a fair idea in mind of when to use your filter and when to opt for a query, let's think of some scenarios and see how Elasticsearch enables filtering at its best. Filtering by a date range, prize, or department often pops up in use cases in an e-commerce view. Look at the left-hand side of the following figure:

Filter your results based on a date range

Checking for new arrivals or selecting an old classic song from a library may need a date-range-based filtering mechanism. Elasticsearch provides inbuilt facilities to do filtering by providing a date range filter. A term filter does the same thing for strings, which can be anything for example, ...

Get Elasticsearch Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.