How to use only the search set generated by the previous query for searching the current query in ElasticSearch

I am working on a Search Engine for searching strings. There is around 600 GB of data stored at ElasticSearch index with 4 nodes, having 5 primary shards and 1 replica set.

Assume there is a complete data set A(600GB) on which first time search, results in a new data set B(30GB) and then filters are applied on the data set B.

As of now I am creating a new query every-time a filter is applied and whole data i.e. set A(600GB) is used for searching, I want to know if there is a way to use only the data set B(30GB) for the subsequent filtering. If yes then how can I achieve this.

I am asking this because I think there should some way to achieve this. Since, when I do the search it shows the number of hits, which I think means ElasticSearch knows exactly which documents I want to use for subsequent filtering.

I am new to ElasticSearch and would like to apologize if you find this question trivial.

Welcome !

Just add to the previous query the new filters you want to apply and you'll be all set.

Hi dadoonet,

Thank-you for the response!


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.