sirensolutions / siren-join

[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]
http://siren.io
GNU Affero General Public License v3.0
183 stars 60 forks source link

Dictionary-based terms filter for highly selective join #78

Closed rendel closed 8 years ago

rendel commented 8 years ago

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:

  1. add a new query type, which is similar in essence to the MultiTermQueryConstantScoreWrapper, and
  2. add a query optimisation logic in the filter join query processing that will detect such scenario and switch to the optimal terms query implementation.