I have a scenario where I need to search for some documents. Values of one of the search field is result of another search query. In typical SQL scenario it looks something like this
Select * from table1 where column1 IN( select columnnx from table2 where date 'sampleDate')
One work around for this I found is to cache this columnx from document2(table2) and use it in termQuerys
boolQuery.must(QueryBuilders.termsQuery(fieldName, cachedList);
However I'm concerned about the performance of this as my cache can grow and have more than 100000 items. So if there is any alternate solution please suggest.
Thanks in advance. P.S . I'm new to elasticsearch.