本文整理汇总了Java中org.elasticsearch.index.fielddata.IndexFieldDataService类的典型用法代码示例。如果您正苦于以下问题:Java IndexFieldDataService类的具体用法?Java IndexFieldDataService怎么用?Java IndexFieldDataService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndexFieldDataService类属于org.elasticsearch.index.fielddata包,在下文中一共展示了IndexFieldDataService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAggregator
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
protected <A extends Aggregator, B extends AggregationBuilder> A createAggregator(B aggregationBuilder,
IndexSearcher indexSearcher,
MappedFieldType... fieldTypes) throws IOException {
IndexSettings indexSettings = createIndexSettings();
SearchContext searchContext = createSearchContext(indexSearcher, indexSettings);
CircuitBreakerService circuitBreakerService = new NoneCircuitBreakerService();
when(searchContext.bigArrays()).thenReturn(new MockBigArrays(Settings.EMPTY, circuitBreakerService));
// TODO: now just needed for top_hits, this will need to be revised for other agg unit tests:
MapperService mapperService = mapperServiceMock();
when(mapperService.hasNested()).thenReturn(false);
when(searchContext.mapperService()).thenReturn(mapperService);
IndexFieldDataService ifds = new IndexFieldDataService(indexSettings,
new IndicesFieldDataCache(Settings.EMPTY, new IndexFieldDataCache.Listener() {
}), circuitBreakerService, mapperService);
when(searchContext.fieldData()).thenReturn(ifds);
SearchLookup searchLookup = new SearchLookup(mapperService, ifds, new String[]{"type"});
when(searchContext.lookup()).thenReturn(searchLookup);
QueryShardContext queryShardContext = queryShardContextMock(fieldTypes, indexSettings, circuitBreakerService);
when(searchContext.getQueryShardContext()).thenReturn(queryShardContext);
@SuppressWarnings("unchecked")
A aggregator = (A) aggregationBuilder.build(searchContext, null).create(null, true);
return aggregator;
}
示例2: FetchCollector
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public FetchCollector(List<LuceneCollectorExpression<?>> collectorExpressions,
MapperService mapperService,
Engine.Searcher searcher,
IndexFieldDataService indexFieldDataService,
int readerId) {
this.collectorExpressions = collectorExpressions;
this.readerContexts = searcher.searcher().getIndexReader().leaves();
this.fieldsVisitor = new CollectorFieldsVisitor(this.collectorExpressions.size());
CollectorContext collectorContext = new CollectorContext(mapperService, indexFieldDataService, fieldsVisitor, readerId);
for (LuceneCollectorExpression<?> collectorExpression : this.collectorExpressions) {
collectorExpression.startCollect(collectorContext);
}
visitorEnabled = fieldsVisitor.required();
this.row = new InputRow(collectorExpressions);
}
示例3: convert
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public Context convert(WhereClause whereClause,
MapperService mapperService,
IndexFieldDataService indexFieldDataService,
IndexCache indexCache) throws UnsupportedFeatureException {
Context ctx = new Context(inputSymbolVisitor, mapperService, indexFieldDataService, indexCache);
if (whereClause.noMatch()) {
ctx.query = Queries.newMatchNoDocsQuery();
} else if (!whereClause.hasQuery()) {
ctx.query = Queries.newMatchAllQuery();
} else {
ctx.query = VISITOR.process(whereClause.query(), ctx);
}
if (LOGGER.isTraceEnabled()) {
if (whereClause.hasQuery()) {
LOGGER.trace("WHERE CLAUSE [{}] -> LUCENE QUERY [{}] ", SymbolPrinter.INSTANCE.printSimple(whereClause.query()), ctx.query);
}
}
return ctx;
}
示例4: IndexQueryParserService
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
@Inject
public IndexQueryParserService(Index index, IndexSettingsService indexSettingsService,
IndicesQueriesRegistry indicesQueriesRegistry,
ScriptService scriptService, AnalysisService analysisService,
MapperService mapperService, IndexCache indexCache, IndexFieldDataService fieldDataService,
BitsetFilterCache bitsetFilterCache,
@Nullable SimilarityService similarityService) {
super(index, indexSettingsService.getSettings());
this.indexSettingsService = indexSettingsService;
this.scriptService = scriptService;
this.analysisService = analysisService;
this.mapperService = mapperService;
this.similarityService = similarityService;
this.indexCache = indexCache;
this.fieldDataService = fieldDataService;
this.bitsetFilterCache = bitsetFilterCache;
Settings indexSettings = indexSettingsService.getSettings();
this.defaultField = indexSettings.get(DEFAULT_FIELD, AllFieldMapper.NAME);
this.queryStringLenient = indexSettings.getAsBoolean(QUERY_STRING_LENIENT, false);
this.parseFieldMatcher = new ParseFieldMatcher(indexSettings);
this.defaultAllowUnmappedFields = indexSettings.getAsBoolean(ALLOW_UNMAPPED, true);
this.indicesQueriesRegistry = indicesQueriesRegistry;
}
示例5: ShadowIndexShard
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
@Inject
public ShadowIndexShard(ShardId shardId, IndexSettingsService indexSettingsService,
IndicesLifecycle indicesLifecycle, Store store, StoreRecoveryService storeRecoveryService,
ThreadPool threadPool, MapperService mapperService,
IndexQueryParserService queryParserService, IndexCache indexCache,
IndexAliasesService indexAliasesService, IndicesQueryCache indicesQueryCache,
ShardPercolateService shardPercolateService, CodecService codecService,
ShardTermVectorsService termVectorsService, IndexFieldDataService indexFieldDataService,
IndexService indexService, @Nullable IndicesWarmer warmer,
SnapshotDeletionPolicy deletionPolicy, SimilarityService similarityService,
EngineFactory factory, ClusterService clusterService,
ShardPath path, BigArrays bigArrays, IndexSearcherWrappingService wrappingService,
IndexingMemoryController indexingMemoryController, SearchService shardSearchService) throws IOException {
super(shardId, indexSettingsService, indicesLifecycle, store, storeRecoveryService,
threadPool, mapperService, queryParserService, indexCache, indexAliasesService,
indicesQueryCache, shardPercolateService, codecService,
termVectorsService, indexFieldDataService, indexService,
warmer, deletionPolicy, similarityService,
factory, clusterService, path, bigArrays, wrappingService, indexingMemoryController, shardSearchService);
}
示例6: newShard
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
/**
* creates a new initializing shard.
*
* @param routing shard routing to use
* @param shardPath path to use for shard data
* @param indexMetaData indexMetaData for the shard, including any mapping
* @param indexSearcherWrapper an optional wrapper to be used during searchers
* @param listeners an optional set of listeners to add to the shard
*/
protected IndexShard newShard(ShardRouting routing, ShardPath shardPath, IndexMetaData indexMetaData,
@Nullable IndexSearcherWrapper indexSearcherWrapper,
Runnable globalCheckpointSyncer,
@Nullable EngineFactory engineFactory,
IndexingOperationListener... listeners) throws IOException {
final Settings nodeSettings = Settings.builder().put("node.name", routing.currentNodeId()).build();
final IndexSettings indexSettings = new IndexSettings(indexMetaData, nodeSettings);
final IndexShard indexShard;
final Store store = createStore(indexSettings, shardPath);
boolean success = false;
try {
IndexCache indexCache = new IndexCache(indexSettings, new DisabledQueryCache(indexSettings), null);
MapperService mapperService = MapperTestUtils.newMapperService(xContentRegistry(), createTempDir(),
indexSettings.getSettings());
mapperService.merge(indexMetaData, MapperService.MergeReason.MAPPING_RECOVERY, true);
SimilarityService similarityService = new SimilarityService(indexSettings, Collections.emptyMap());
final IndexEventListener indexEventListener = new IndexEventListener() {
};
final Engine.Warmer warmer = searcher -> {
};
IndicesFieldDataCache indicesFieldDataCache = new IndicesFieldDataCache(nodeSettings, new IndexFieldDataCache.Listener() {
});
IndexFieldDataService indexFieldDataService = new IndexFieldDataService(indexSettings, indicesFieldDataCache,
new NoneCircuitBreakerService(), mapperService);
indexShard = new IndexShard(routing, indexSettings, shardPath, store, indexCache, mapperService, similarityService,
indexFieldDataService, engineFactory, indexEventListener, indexSearcherWrapper, threadPool,
BigArrays.NON_RECYCLING_INSTANCE, warmer, globalCheckpointSyncer, Collections.emptyList(), Arrays.asList(listeners));
success = true;
} finally {
if (success == false) {
IOUtils.close(store);
}
}
return indexShard;
}
示例7: getSearchContext
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
private static SearchContext getSearchContext(String[] types, QueryShardContext context) {
TestSearchContext testSearchContext = new TestSearchContext(context) {
@Override
public MapperService mapperService() {
return serviceHolder.mapperService; // need to build / parse inner hits sort fields
}
@Override
public IndexFieldDataService fieldData() {
return serviceHolder.indexFieldDataService; // need to build / parse inner hits sort fields
}
};
testSearchContext.getQueryShardContext().setTypes(types);
return testSearchContext;
}
示例8: QueryShardContext
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public QueryShardContext(int shardId, IndexSettings indexSettings, BitsetFilterCache bitsetFilterCache,
IndexFieldDataService indexFieldDataService, MapperService mapperService, SimilarityService similarityService,
ScriptService scriptService, NamedXContentRegistry xContentRegistry,
Client client, IndexReader reader, LongSupplier nowInMillis) {
super(indexSettings, mapperService, scriptService, xContentRegistry, client, reader, nowInMillis);
this.shardId = shardId;
this.indexSettings = indexSettings;
this.similarityService = similarityService;
this.mapperService = mapperService;
this.bitsetFilterCache = bitsetFilterCache;
this.indexFieldDataService = indexFieldDataService;
this.allowUnmappedFields = indexSettings.isDefaultAllowUnmappedFields();
this.nestedScope = new NestedScope();
}
示例9: ShadowIndexShard
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public ShadowIndexShard(ShardRouting shardRouting, IndexSettings indexSettings, ShardPath path, Store store, IndexCache indexCache,
MapperService mapperService, SimilarityService similarityService, IndexFieldDataService indexFieldDataService,
@Nullable EngineFactory engineFactory, IndexEventListener indexEventListener, IndexSearcherWrapper wrapper,
ThreadPool threadPool, BigArrays bigArrays, Engine.Warmer engineWarmer,
List<SearchOperationListener> searchOperationListeners) throws IOException {
super(shardRouting, indexSettings, path, store, indexCache, mapperService, similarityService, indexFieldDataService, engineFactory,
indexEventListener, wrapper, threadPool, bigArrays, engineWarmer, () -> {
}, searchOperationListeners, Collections.emptyList());
}
示例10: DLBasedIndexShard
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
@Inject
public DLBasedIndexShard(ShardId shardId,
IndexSettingsService indexSettingsService,
IndicesLifecycle indicesLifecycle, Store store,
StoreRecoveryService storeRecoveryService, ThreadPool threadPool,
MapperService mapperService,
IndexQueryParserService queryParserService, IndexCache indexCache,
IndexAliasesService indexAliasesService,
IndicesQueryCache indicesQueryCache,
ShardPercolateService shardPercolateService,
CodecService codecService,
ShardTermVectorsService termVectorsService,
IndexFieldDataService indexFieldDataService,
IndexService indexService, IndicesWarmer warmer,
SnapshotDeletionPolicy deletionPolicy,
SimilarityService similarityService, EngineFactory factory,
ClusterService clusterService, ShardPath path, BigArrays bigArrays,
IndexSearcherWrappingService wrappingService,
IndexingMemoryController indexingMemoryController,
TransportGetOrChangePrimaryShardLeaseAction checkLeaseAction,
TransportIndexShardStatsAction indexShardStatsAction,
SearchService shardSearchService) {
super(shardId, indexSettingsService, indicesLifecycle, store,
storeRecoveryService, threadPool, mapperService, queryParserService,
indexCache, indexAliasesService, indicesQueryCache,
shardPercolateService, codecService, termVectorsService,
indexFieldDataService, indexService, warmer, deletionPolicy,
similarityService, factory, clusterService, path, bigArrays,
wrappingService, indexingMemoryController, shardSearchService);
this.localNodeId = clusterService.state().nodes().localNodeId();
this.checkLeaseAction = checkLeaseAction;
this.indexShardStatsAction = indexShardStatsAction;
}
示例11: CollectorContext
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public CollectorContext(MapperService mapperService,
IndexFieldDataService fieldData,
CollectorFieldsVisitor visitor,
int jobSearchContextId) {
this.mapperService = mapperService;
this.fieldData = fieldData;
fieldsVisitor = visitor;
this.jobSearchContextId = jobSearchContextId;
}
示例12: Context
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
Context(CollectInputSymbolVisitor<LuceneCollectorExpression<?>> inputSymbolVisitor,
MapperService mapperService,
IndexFieldDataService fieldDataService,
IndexCache indexCache) {
this.inputSymbolVisitor = inputSymbolVisitor;
this.mapperService = mapperService;
this.fieldDataService = fieldDataService;
this.indexCache = indexCache;
}
示例13: SearchLookup
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public SearchLookup(MapperService mapperService, IndexFieldDataService fieldDataService, @Nullable String[] types) {
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
docMap = new DocLookup(mapperService, fieldDataService, types);
sourceLookup = new SourceLookup();
fieldsLookup = new FieldsLookup(mapperService, types);
indexLookup = new IndexLookup(builder);
asMap = builder.build();
}
示例14: PercolatorQueriesRegistry
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
public PercolatorQueriesRegistry(ShardId shardId, Settings indexSettings, IndexQueryParserService queryParserService,
ShardIndexingService indexingService, IndicesLifecycle indicesLifecycle, MapperService mapperService,
IndexFieldDataService indexFieldDataService, ShardPercolateService shardPercolateService) {
super(shardId, indexSettings);
this.queryParserService = queryParserService;
this.mapperService = mapperService;
this.indicesLifecycle = indicesLifecycle;
this.indexingService = indexingService;
this.indexFieldDataService = indexFieldDataService;
this.shardPercolateService = shardPercolateService;
this.mapUnmappedFieldsAsString = indexSettings.getAsBoolean(MAP_UNMAPPED_FIELDS_AS_STRING, false);
indicesLifecycle.addListener(shardLifecycleListener);
mapperService.addTypeListener(percolateTypeListener);
}
示例15: IndexService
import org.elasticsearch.index.fielddata.IndexFieldDataService; //导入依赖的package包/类
@Inject
public IndexService(Injector injector, Index index, NodeEnvironment nodeEnv,
AnalysisService analysisService, MapperService mapperService, IndexQueryParserService queryParserService,
SimilarityService similarityService, IndexAliasesService aliasesService, IndexCache indexCache,
IndexSettingsService settingsService,
IndexFieldDataService indexFieldData, BitsetFilterCache bitSetFilterCache, IndicesService indicesServices) {
super(index, settingsService.getSettings());
this.injector = injector;
this.analysisService = analysisService;
this.mapperService = mapperService;
this.queryParserService = queryParserService;
this.similarityService = similarityService;
this.aliasesService = aliasesService;
this.indexCache = indexCache;
this.indexFieldData = indexFieldData;
this.settingsService = settingsService;
this.bitsetFilterCache = bitSetFilterCache;
this.pluginsService = injector.getInstance(PluginsService.class);
this.indicesServices = indicesServices;
this.indicesLifecycle = (InternalIndicesLifecycle) injector.getInstance(IndicesLifecycle.class);
// inject workarounds for cyclic dep
indexFieldData.setListener(new FieldDataCacheListener(this));
bitSetFilterCache.setListener(new BitsetCacheListener(this));
this.nodeEnv = nodeEnv;
}