elasticsearch

Elasticsearch intervals vs span near?


I want to filter by the distance between two terms both ordered and unordered

Seems both intervals and span query can solve this. However at first glance span query is a nightmare to use with other queries because a span query can contain only other span query.

So intervals query is enough for me? Or what is the advantage to use span query?


Solution

  • Interval queries are meant to be the long-term replacement for the span queries. They were added exactly to improve the user experience. If they work for you, you should continue to use them.