Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher #8967

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Jul 28, 2023

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher). The latter provides LeafCollector hooks to optimize for concurrent queries. This commit cuts over usage of rewrite(IndexReader) to rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query optimizations.

relates #8932
relates #8963

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator

reta commented Jul 28, 2023

  • RESULT: FAILURE x

Should be fixed by #8968

nknize added 2 commits July 28, 2023 12:49
Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize force-pushed the LuceneDeprecations branch from 7b931e7 to ab03621 Compare July 28, 2023 18:03
@nknize nknize requested a review from reta July 28, 2023 18:15
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #8967 (ab03621) into main (b4b25dc) will decrease coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 80.00%.

@@             Coverage Diff              @@
##               main    #8967      +/-   ##
============================================
- Coverage     71.08%   71.06%   -0.02%     
- Complexity    57185    57212      +27     
============================================
  Files          4759     4759              
  Lines        269885   269888       +3     
  Branches      39489    39490       +1     
============================================
- Hits         191843   191796      -47     
- Misses        61835    61964     +129     
+ Partials      16207    16128      -79     
Files Changed Coverage Δ
...rg/opensearch/join/query/HasChildQueryBuilder.java 80.86% <0.00%> (-0.39%) ⬇️
...search/index/query/DateRangeIncludingNowQuery.java 76.92% <ø> (ø)
...search/suggest/completion/CompletionSuggester.java 2.56% <0.00%> (ø)
...search/common/lucene/search/MoreLikeThisQuery.java 58.38% <50.00%> (ø)
...java/org/opensearch/percolator/PercolateQuery.java 73.91% <100.00%> (ø)
...va/org/apache/lucene/queries/BlendedTermQuery.java 70.27% <100.00%> (+0.16%) ⬆️
...h/common/lucene/search/MultiPhrasePrefixQuery.java 62.68% <100.00%> (ø)
...mon/lucene/search/function/FunctionScoreQuery.java 84.78% <100.00%> (ø)
...ommon/lucene/search/function/ScriptScoreQuery.java 67.18% <100.00%> (ø)
...ocument/SortedUnsignedLongDocValuesRangeQuery.java 65.45% <100.00%> (+1.81%) ⬆️
... and 2 more

... and 468 files with indirect coverage changes

@reta reta merged commit b282005 into opensearch-project:main Jul 28, 2023
@reta reta added the backport 2.x Backport to 2.x branch label Jul 28, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 28, 2023
…er (#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
(cherry picked from commit b282005)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Jul 28, 2023
…er (#8967) (#8977)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.



* remove stray collector.finish



---------


(cherry picked from commit b282005)

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 28, 2023
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
baba-devv pushed a commit to baba-devv/OpenSearch that referenced this pull request Jul 29, 2023
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>

---------

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request skip-changelog v2.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants