mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-29 01:44:36 -04:00
Expose the bitset filter cache in the MappingParserContext (#109298)
Add the bitset filter cache in the MappingParserContext
This commit is contained in:
parent
32dfd1866e
commit
564549af8f
18 changed files with 119 additions and 24 deletions
|
@ -9,6 +9,7 @@
|
|||
package org.elasticsearch.benchmark.index.mapper;
|
||||
|
||||
import org.apache.lucene.analysis.standard.StandardAnalyzer;
|
||||
import org.apache.lucene.util.Accountable;
|
||||
import org.elasticsearch.TransportVersion;
|
||||
import org.elasticsearch.cluster.ClusterModule;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||
|
@ -21,10 +22,12 @@ import org.elasticsearch.index.analysis.AnalyzerScope;
|
|||
import org.elasticsearch.index.analysis.IndexAnalyzers;
|
||||
import org.elasticsearch.index.analysis.LowercaseNormalizer;
|
||||
import org.elasticsearch.index.analysis.NamedAnalyzer;
|
||||
import org.elasticsearch.index.cache.bitset.BitsetFilterCache;
|
||||
import org.elasticsearch.index.mapper.MapperMetrics;
|
||||
import org.elasticsearch.index.mapper.MapperRegistry;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
import org.elasticsearch.index.mapper.ProvidedIdFieldMapper;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.similarity.SimilarityService;
|
||||
import org.elasticsearch.indices.IndicesModule;
|
||||
import org.elasticsearch.script.Script;
|
||||
|
@ -52,6 +55,13 @@ public class MapperServiceFactory {
|
|||
MapperRegistry mapperRegistry = new IndicesModule(Collections.emptyList()).getMapperRegistry();
|
||||
|
||||
SimilarityService similarityService = new SimilarityService(indexSettings, null, Map.of());
|
||||
BitsetFilterCache bitsetFilterCache = new BitsetFilterCache(indexSettings, new BitsetFilterCache.Listener() {
|
||||
@Override
|
||||
public void onCache(ShardId shardId, Accountable accountable) {}
|
||||
|
||||
@Override
|
||||
public void onRemoval(ShardId shardId, Accountable accountable) {}
|
||||
});
|
||||
MapperService mapperService = new MapperService(
|
||||
() -> TransportVersion.current(),
|
||||
indexSettings,
|
||||
|
@ -73,6 +83,7 @@ public class MapperServiceFactory {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
},
|
||||
bitsetFilterCache::getBitSetProducer,
|
||||
MapperMetrics.NOOP
|
||||
);
|
||||
|
||||
|
|
|
@ -189,6 +189,7 @@ public class QueryParserHelperBenchmark {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
},
|
||||
query -> { throw new UnsupportedOperationException(); },
|
||||
MapperMetrics.NOOP
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue