join: repeat BytesRefHash.sort() in TermsQuery after TermsIncludingScoreQuery
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
### Description
* The `TermsIncludingScoreQuery` constructor as per https://github.com/apache/lucene/blob/releases/lucene/9.9.1/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java#L74 does a `BytesRefHash.sort()` call on the `terms` object passed in to it.
* Subsequently `TermsIncludingScoreQuery.createWeight` as per https://github.com/apache/lucene/blob/releases/lucene/9.9.1/lucene/join/src/java/org/apache/lucene/search/join/TermsIncludingScoreQuery.java#L134 passes the `terms` object to the `TermsQuery` constructor.
* The `TermsQuery` constructor as per https://github.com/apache/lucene/blob/releases/lucene/9.9.1/lucene/join/src/java/org/apache/lucene/search/join/TermsQuery.java#L68 also does a `BytesRefHash.sort()` call on the `terms` object passed in to it.
The current Lucene tests pass but on the dev mailing as per https://lists.apache.org/thread/ms65gkmm86cpp5ntdo555ob8mrgg64o5 test failures for `org.apache.solr.search.join.ScoreJoinQParserPlugin` were reported and it was mentioned that after the #12784 changes `BytesRefHash#sort` may no longer be called more than once.
### Version and environment details
_No response_
Contributor guide
Research direction
Start with TermsIncludingScoreQuery.java and TermsQuery.java at the constructors and createWeight locations cited in the issue, then review the BytesRefHash.sort() behavior changed by #12784. Check the reported ScoreJoinQParserPlugin failures and existing Lucene join tests; done means the terms are not sorted repeatedly and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100