Skip to content

Commit 54687c2

Browse files
committed
lucene 10.4.0
1 parent 14fa069 commit 54687c2

File tree

18 files changed

+46
-40
lines changed

18 files changed

+46
-40
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexAnalysisSettingsAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public IndexAnalysisSettings3[] read(IndexReader reader, int n) throws IOExcepti
8989
}
9090
TopDocs top = searcher.search(q, n);
9191

92-
int nres = top.totalHits.value > n ? n : (int) top.totalHits.value;
92+
int nres = top.totalHits.value() > n ? n : (int) top.totalHits.value();
9393
IndexAnalysisSettings3[] res = new IndexAnalysisSettings3[nres];
9494

9595
IndexAnalysisSettingsUpgrader upgrader = new IndexAnalysisSettingsUpgrader();

opengrok-indexer/src/main/java/org/opengrok/indexer/index/IndexDatabase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,10 +2088,10 @@ public static Document getDocument(File file) throws ParseException, IOException
20882088
Statistics stat = new Statistics();
20892089
TopDocs top = searcher.search(q, 1);
20902090
stat.report(LOGGER, Level.FINEST,
2091-
String.format("search via getDocument(%s) done (%d hits)", file, top.totalHits.value),
2091+
String.format("search via getDocument(%s) done (%d hits)", file, top.totalHits.value()),
20922092
"search.latency", new String[]{"category", "getdocument",
2093-
"outcome", top.totalHits.value == 0 ? "empty" : "success"});
2094-
if (top.totalHits.value == 0) {
2093+
"outcome", top.totalHits.value() == 0 ? "empty" : "success"});
2094+
if (top.totalHits.value() == 0) {
20952095
// No hits, no document...
20962096
return null;
20972097
}

opengrok-indexer/src/main/java/org/opengrok/indexer/index/NumLinesLOCAccessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NumLinesLOCAccessor {
6565
*/
6666
public boolean hasStored(IndexReader reader) throws IOException {
6767
DSearchResult searchResult = newDSearch(reader, 1);
68-
return searchResult.hits.totalHits.value > 0;
68+
return searchResult.hits.totalHits.value() > 0;
6969
}
7070

7171
/**
@@ -121,8 +121,8 @@ private void storeBulk(IndexWriter writer, IndexReader reader,
121121

122122
// Index the existing document IDs by QueryBuilder.D.
123123
HashMap<String, Integer> byDir = new HashMap<>();
124-
int intMaximum = Integer.MAX_VALUE < searchResult.hits.totalHits.value ?
125-
Integer.MAX_VALUE : (int) searchResult.hits.totalHits.value;
124+
int intMaximum = Integer.MAX_VALUE < searchResult.hits.totalHits.value() ?
125+
Integer.MAX_VALUE : (int) searchResult.hits.totalHits.value();
126126
StoredFields storedFields = searchResult.searcher.storedFields();
127127
for (int i = 0; i < intMaximum; ++i) {
128128
int docID = searchResult.hits.scoreDocs[i].doc;
@@ -148,7 +148,7 @@ private void storeIterative(IndexWriter writer, IndexReader reader,
148148
TopDocs hits = searcher.search(query, 1);
149149

150150
Integer docID = null;
151-
if (hits.totalHits.value > 0) {
151+
if (hits.totalHits.value() > 0) {
152152
docID = hits.scoreDocs[0].doc;
153153
}
154154
updateDocumentData(writer, searcher, entry, docID, isAggregatingDeltas);

opengrok-indexer/src/main/java/org/opengrok/indexer/search/QueryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ protected Query buildQuery(String field, String queryText)
502502
*/
503503
private boolean hasClause(BooleanQuery query, Occur occur) {
504504
for (BooleanClause clause : query) {
505-
if (clause.getOccur().equals(occur)) {
505+
if (clause.occur().equals(occur)) {
506506
return true;
507507
}
508508
}

opengrok-indexer/src/main/java/org/opengrok/indexer/search/SearchEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private void searchIndex(IndexSearcher searcher, boolean paging) throws IOExcept
232232
topDocs = searcher.search(query, new TopFieldCollectorManager(luceneSort, numHits, Short.MAX_VALUE));
233233
}
234234
hits = topDocs.scoreDocs;
235-
totalHits = (int) topDocs.totalHits.value;
235+
totalHits = (int) topDocs.totalHits.value();
236236

237237
Statistics stat = new Statistics();
238238
stat.report(LOGGER, Level.FINEST, "search via SearchEngine done",

opengrok-indexer/src/main/java/org/opengrok/indexer/search/Summarizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private void getTerms(Query query) {
330330
private void getBooleans(BooleanQuery query) {
331331
for (BooleanClause clause : query) {
332332
if (!clause.isProhibited()) {
333-
getTerms(clause.getQuery());
333+
getTerms(clause.query());
334334
}
335335
}
336336
}

opengrok-indexer/src/main/java/org/opengrok/indexer/search/context/OGKUnifiedHighlighter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ protected List<CharSequence[]> loadFieldValues(String[] fields,
247247
protected OffsetSource getOptimizedOffsetSource(UHComponents components) {
248248

249249
OffsetSource res = super.getOptimizedOffsetSource(components);
250-
String field = components.getField();
250+
String field = components.field();
251251
if (res == OffsetSource.ANALYSIS) {
252252
/*
253253
Testing showed that UnifiedHighlighter falls back to

opengrok-indexer/src/main/java/org/opengrok/indexer/search/context/QueryMatchers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private void getRegexp(RegexpQuery query) {
105105
private void getBooleans(BooleanQuery query) {
106106
for (BooleanClause clause : query) {
107107
if (!clause.isProhibited()) {
108-
getTerms(clause.getQuery());
108+
getTerms(clause.query());
109109
}
110110
}
111111
}

opengrok-indexer/src/main/java/org/opengrok/indexer/web/SearchHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public SearchHelper executeQuery() {
476476
}
477477
try {
478478
TopFieldDocs fdocs = searcher.search(query, start + maxItems, sort);
479-
totalHits = fdocs.totalHits.value;
479+
totalHits = fdocs.totalHits.value();
480480
hits = fdocs.scoreDocs;
481481

482482
/*
@@ -743,7 +743,7 @@ public int searchSingle(File file) throws IOException,
743743
query = singleBuilder.setPath(path).build();
744744

745745
TopDocs top = searcher.search(query, 1);
746-
if (top.totalHits.value == 0) {
746+
if (top.totalHits.value() == 0) {
747747
return -1;
748748
}
749749

opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTestHistBasedIterationTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.apache.lucene.index.TermsEnum;
3232
import org.apache.lucene.util.AttributeSource;
3333
import org.apache.lucene.util.BytesRef;
34+
import org.apache.lucene.util.IOBooleanSupplier;
3435
import org.junit.jupiter.api.AfterEach;
3536
import org.junit.jupiter.api.BeforeEach;
3637
import org.junit.jupiter.api.Test;
@@ -109,6 +110,11 @@ public boolean seekExact(BytesRef bytesRef) throws IOException {
109110
return false;
110111
}
111112

113+
@Override
114+
public IOBooleanSupplier prepareSeekExact(BytesRef bytesRef) throws IOException {
115+
return null;
116+
}
117+
112118
@Override
113119
public SeekStatus seekCeil(BytesRef bytesRef) throws IOException {
114120
return null;

0 commit comments

Comments
 (0)