You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/11/11 23:35:47 UTC

[GitHub] [lucene] gsmiller opened a new pull request #435: LUCENE-10207: Add "slow" term-in-set query support to SortedDocValuesField / SortedSetDocValuesField

gsmiller opened a new pull request #435:
URL: https://github.com/apache/lucene/pull/435


   # Description
   
   This change introduces "slow" term-in-set query support exposed through SDV and SSDV Fields. These "slow" queries can be combined with standard TermInSet queries in an IndexOrDocValues query for efficient term-in-set querying when both postings and doc values exist for a given string field.
   
   # Solution
   
   `TermInSetQuery` now extends `MultiTermQuery`, which allows it to be rewritten as a "doc values query" using `DocValuesRewriteMethod`. `scorerSupplier` support was added to `MultiTermQueryConstantScoreWrapper` and `DocValuesRewriteMethod`, allowing up-front cost estimation without doing the "heavy lifting" of intersecting the query terms with the indexed terms (while the "doc values" based approach doesn't require score estimation, `IndexOrDocValuesQuery` creates `ScorerSupplier`s for both delegate queries up-front, so we want to avoid the term intersection cost).
   
   # Tests
   
   Added new unit test coverage for the updated functionality. Note that I also needed to update `TestPresearcherMatchCollector` since it relies on `toString()`. Previously, the `TermInSetQuery` was being rewritten directly to a `BooleanQuery`. Now though, it gets rewritten to `MultiTermQueryConstantScoreWrapper` which handles the `BooleanQuery` rewriting on-demand when a `Scorer` is requested. Because these two queries have different `toString` representations, the test started failing (even though it's functionally equivalent).
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/lucene/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Lucene maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org