Skip to content

Commit 5a34fb2

Browse files
committed
Fix compilation issues due to lucene update
1 parent 8e2ce12 commit 5a34fb2

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/AbstractCompoundWordTokenFilterFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public abstract class AbstractCompoundWordTokenFilterFactory extends AbstractTok
2828
protected final int maxSubwordSize;
2929
protected final boolean onlyLongestMatch;
3030
protected final CharArraySet wordList;
31+
// TODO expose this parameter?
32+
protected final boolean reuseChars;
3133

3234
protected AbstractCompoundWordTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
3335
super(name);
@@ -36,6 +38,8 @@ protected AbstractCompoundWordTokenFilterFactory(IndexSettings indexSettings, En
3638
minSubwordSize = settings.getAsInt("min_subword_size", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
3739
maxSubwordSize = settings.getAsInt("max_subword_size", CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE);
3840
onlyLongestMatch = settings.getAsBoolean("only_longest_match", false);
41+
// TODO is the default of true correct? see: https://github.com/apache/lucene/pull/14278
42+
reuseChars = true;
3943
wordList = Analysis.getWordSet(env, settings, "word_list");
4044
if (wordList == null) {
4145
throw new IllegalArgumentException("word_list must be provided for [" + name + "], either as a path to a file, or directly");

modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/DictionaryCompoundWordTokenFilterFactory.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public class DictionaryCompoundWordTokenFilterFactory extends AbstractCompoundWo
2828

2929
@Override
3030
public TokenStream create(TokenStream tokenStream) {
31-
return new DictionaryCompoundWordTokenFilter(tokenStream, wordList, minWordSize, minSubwordSize, maxSubwordSize, onlyLongestMatch);
31+
return new DictionaryCompoundWordTokenFilter(
32+
tokenStream,
33+
wordList,
34+
minWordSize,
35+
minSubwordSize,
36+
maxSubwordSize,
37+
onlyLongestMatch,
38+
reuseChars
39+
);
3240
}
3341
}

server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ DocIdSet processLeaf(CompositeValuesCollectorQueue queue, LeafReaderContext cont
5858
}
5959
upperBucket = (Long) upperValue;
6060
}
61-
DocIdSetBuilder builder = fillDocIdSet ? new DocIdSetBuilder(context.reader().maxDoc(), values, field) : null;
61+
DocIdSetBuilder builder = fillDocIdSet ? new DocIdSetBuilder(context.reader().maxDoc(), values) : null;
6262
Visitor visitor = new Visitor(context, queue, builder, values.getBytesPerDimension(), lowerBucket, upperBucket);
6363
try {
6464
values.intersect(visitor);

server/src/main/java/org/elasticsearch/search/aggregations/bucket/filter/FiltersAggregator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ private final class MultiFilterLeafCollector extends AbstractLeafCollector {
417417
boolean hasOtherBucket
418418
) {
419419
super(sub, numFilters, totalNumKeys, false, hasOtherBucket);
420-
filterIterators = filterWrappers.isEmpty() ? null : new DisiPriorityQueue(filterWrappers.size());
420+
filterIterators = filterWrappers.isEmpty() ? null : DisiPriorityQueue.ofMaxSize(filterWrappers.size());
421421
for (FilterMatchingDisiWrapper wrapper : filterWrappers) {
422422
filterIterators.add(wrapper);
423423
}

0 commit comments

Comments
 (0)