Skip to content

Update lucene from 9.12.3 to 10.5.1 - #766

Open
mbien wants to merge 1 commit into
apache:masterfrom
mbien:lucene-10
Open

mbien wants to merge 1 commit into
apache:masterfrom
mbien:lucene-10

Conversation

@mbien

@mbien mbien commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

only minor changes were needed. There is no hurry to get this in, but I have done something similar for the NetBeans code indexer (apache/netbeans#9593), so I thought to open a PR for the maven-indexer too.

edit: pr is now smaller due to #766 (comment)

  • lower bound becomes JDK 21
  • migrated lucene usage
  • temp: set modernizer plugin failOnViolations=false until codebase is modernized (lower bound bump unlocked more cleanups)

https://lucene.apache.org/core/10_5_1/changes/Changes.html

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Comment on lines +113 to 118
// TODO list never read?
List<MatchHighlightRequest> matchHighlightRequests = new ArrayList<>();
for (MatchHighlightRequest hr : request.getMatchHighlightRequests()) {
Query rewrittenQuery = hr.getQuery().rewrite(indexSearcher.getIndexReader());
Query rewrittenQuery = hr.getQuery().rewrite(indexSearcher);
matchHighlightRequests.add(new MatchHighlightRequest(hr.getField(), rewrittenQuery, hr.getHighlightMode()));
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section appears to be a no-op. Maybe it was meant to populate the field above instead of the variable with the same name?

Comment on lines +201 to +208
hitCount += collector.getTotalHits();
hitCount += topdocs.totalHits.value();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totalHits value is now a long, the maven-indexer response api is still using int, I didn't change that. (see casts marked with TODO)

@slachiewicz

Copy link
Copy Markdown
Member

hi @mbien I've applayed fix to remove deprecated api usage, and few more cleanups in #794

can You test if new code works for You?

@mbien

mbien commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

sure, i can try to rebase this PR.

@mbien

mbien commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

modernizer wants me to refactor unrelated code due to the bump of the lower bound. Haven't done that.

@mbien

mbien commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

I could set failOnViolations to false temporarily. Could be enabled again with the next modernization PR.

 - lower bound becomes JDK 21
 - migrated lucene usage
 - temp: set modernizer plugin failOnViolations=false until codebase
   is modernized (lower bound bump unlocked more cleanups)
void indexPackingRequestPath() {
IndexPackingRequest request =
new IndexPackingRequest(mock(IndexingContext.class), mock(IndexReader.class), dir);
IndexPackingRequest request = new IndexPackingRequest(mock(IndexingContext.class), mock(LeafReader.class), dir);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case anyone is wondering: IndexReader is no longer mockable since its sealed+abstract, so I had to pick a leaf interface.

@mbien
mbien marked this pull request as ready for review September 29, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants