NIFI-13898 Upgraded Lucene from 9.12.0 to 10.0.0

This closes #9420

- Adjusted TotalHits.value() references aligning with Lucene 10 changes

Signed-off-by: Joseph Witt <joewitt@apache.org>
This commit is contained in:
exceptionfactory 2024-10-18 15:07:22 -05:00 committed by Joseph Witt
parent 082b5aefef
commit 1bcc61ebb4
No known key found for this signature in database
GPG Key ID: 9093BF854F811A1A
3 changed files with 4 additions and 4 deletions

View File

@ -179,7 +179,7 @@ public class QueryTask implements Runnable {
private Tuple<List<ProvenanceEventRecord>, Long> readDocuments(final TopDocs topDocs, final StoredFields storedFields) { private Tuple<List<ProvenanceEventRecord>, Long> readDocuments(final TopDocs topDocs, final StoredFields storedFields) {
// If no topDocs is supplied, just provide a Tuple that has no records and a hit count of 0. // If no topDocs is supplied, just provide a Tuple that has no records and a hit count of 0.
if (topDocs == null || topDocs.totalHits.value == 0) { if (topDocs == null || topDocs.totalHits.value() == 0) {
return new Tuple<>(Collections.<ProvenanceEventRecord> emptyList(), 0L); return new Tuple<>(Collections.<ProvenanceEventRecord> emptyList(), 0L);
} }
@ -210,7 +210,7 @@ public class QueryTask implements Runnable {
final long fetchEventNanos = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - endConvert); final long fetchEventNanos = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - endConvert);
logger.debug("Fetching {} events from Event Store took {} ms ({} events actually fetched)", eventIds.size(), fetchEventNanos, events.size()); logger.debug("Fetching {} events from Event Store took {} ms ({} events actually fetched)", eventIds.size(), fetchEventNanos, events.size());
final long totalHits = topDocs.totalHits.value; final long totalHits = topDocs.totalHits.value();
return new Tuple<>(events, totalHits); return new Tuple<>(events, totalHits);
} }

View File

@ -97,7 +97,7 @@ public class TestSimpleIndexManager {
final EventIndexSearcher searcher = mgr.borrowIndexSearcher(dir); final EventIndexSearcher searcher = mgr.borrowIndexSearcher(dir);
final TopDocs topDocs = searcher.getIndexSearcher().search(new MatchAllDocsQuery(), 2); final TopDocs topDocs = searcher.getIndexSearcher().search(new MatchAllDocsQuery(), 2);
assertEquals(2, topDocs.totalHits.value); assertEquals(2, topDocs.totalHits.value());
mgr.returnIndexSearcher(searcher); mgr.returnIndexSearcher(searcher);
} finally { } finally {
FileUtils.deleteFile(dir, true); FileUtils.deleteFile(dir, true);

View File

@ -27,7 +27,7 @@
<module>nifi-provenance-repository-nar</module> <module>nifi-provenance-repository-nar</module>
</modules> </modules>
<properties> <properties>
<lucene.version>9.12.0</lucene.version> <lucene.version>10.0.0</lucene.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>