mikemccand / stargazers-migration-test

Testing Lucene's Jira -> GitHub issues migration
0 stars 0 forks source link

Implementation of MultiTermQuery for ORed Queries [LUCENE-8899] #896

Closed mikemccand closed 5 years ago

mikemccand commented 5 years ago

While working on multi range queries, I realised that it would be good to specialize for cases where all clauses in a query are ORed together. MultiTermQuery springs to mind, when all terms are basically disjuncted.


Legacy Jira details

LUCENE-8899 by Atri Sharma (@atris) on Jul 02 2019, resolved Jul 02 2019

mikemccand commented 5 years ago

The way I am thinking of this is by using the fact that MultiTermQueryConstantScoreWrapper will always convert to a BooleanQuery with each clause as SHOULD. So it should be a simple matter to use that logic. The main change will be introduction of a new TermsEnum implementation which can filter the input terms based on a filter built from the terms list given in the query.

 

Does this seem like a reasonable approach?

[Legacy Jira: Atri Sharma (@atris) on Jul 02 2019]

mikemccand commented 5 years ago

This sounds very similar to what TermInSetQuery is doing, am I missing something?

[Legacy Jira: Adrien Grand (@jpountz) on Jul 02 2019]

mikemccand commented 5 years ago

Hmm, true. I was thinking of a query type just for the disjunctives, but looks like TermInSetQuery already covers it.

 

Thanks for pointing it out!

[Legacy Jira: Atri Sharma (@atris) on Jul 02 2019]