[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]
If the terms set of a filter join is small in size, then a filtering based on the dictionary and inverted index will be more efficient than the current filtering approach which requires scanning the doc value.
We need to:
add a new query type, which is similar in essence to the MultiTermQueryConstantScoreWrapper, and
add a query optimisation logic in the filter join query processing that will detect such scenario and switch to the optimal terms query implementation.
If the terms set of a filter join is small in size, then a filtering based on the dictionary and inverted index will be more efficient than the current filtering approach which requires scanning the doc value. We need to:
MultiTermQueryConstantScoreWrapper
, and