本文整理汇总了Java中org.elasticsearch.index.IndexService.fieldData方法的典型用法代码示例。如果您正苦于以下问题:Java IndexService.fieldData方法的具体用法?Java IndexService.fieldData怎么用?Java IndexService.fieldData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.index.IndexService
的用法示例。
在下文中一共展示了IndexService.fieldData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PercolateContext
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public PercolateContext(PercolateShardRequest request, SearchShardTarget searchShardTarget, IndexShard indexShard,
IndexService indexService, PageCacheRecycler pageCacheRecycler,
BigArrays bigArrays, ScriptService scriptService, Query aliasFilter, ParseFieldMatcher parseFieldMatcher) {
super(parseFieldMatcher, request);
this.indexShard = indexShard;
this.indexService = indexService;
this.fieldDataService = indexService.fieldData();
this.searchShardTarget = searchShardTarget;
this.percolateQueries = indexShard.percolateRegistry().percolateQueries();
this.types = new String[]{request.documentType()};
this.pageCacheRecycler = pageCacheRecycler;
this.bigArrays = bigArrays.withCircuitBreaking();
this.querySearchResult = new QuerySearchResult(0, searchShardTarget);
this.engineSearcher = indexShard.acquireSearcher("percolate");
this.searcher = new ContextIndexSearcher(engineSearcher, indexService.cache().query(), indexShard.getQueryCachingPolicy());
this.scriptService = scriptService;
this.numberOfShards = request.getNumberOfShards();
this.aliasFilter = aliasFilter;
this.startTime = request.getStartTime();
}
示例2: setUp
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
IndexService index = createIndex("test", Settings.EMPTY, "type", "d", "type=double");
service = new ExpressionScriptEngineService(Settings.EMPTY);
lookup = new SearchLookup(index.mapperService(), index.fieldData(), null);
}
示例3: testNeedsScores
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public void testNeedsScores() {
IndexService index = createIndex("test", Settings.EMPTY, "type", "d", "type=double");
PainlessScriptEngineService service = new PainlessScriptEngineService(Settings.EMPTY);
SearchLookup lookup = new SearchLookup(index.mapperService(), index.fieldData(), null);
Object compiled = service.compile(null, "1.2", Collections.emptyMap());
SearchScript ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled),
lookup, Collections.<String, Object>emptyMap());
assertFalse(ss.needsScores());
compiled = service.compile(null, "doc['d'].value", Collections.emptyMap());
ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled),
lookup, Collections.<String, Object>emptyMap());
assertFalse(ss.needsScores());
compiled = service.compile(null, "1/_score", Collections.emptyMap());
ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled),
lookup, Collections.<String, Object>emptyMap());
assertTrue(ss.needsScores());
compiled = service.compile(null, "doc['d'].value * _score", Collections.emptyMap());
ss = service.search(new CompiledScript(ScriptType.INLINE, "randomName", "painless", compiled),
lookup, Collections.<String, Object>emptyMap());
assertTrue(ss.needsScores());
service.close();
}
示例4: TestSearchContext
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public TestSearchContext(ThreadPool threadPool, BigArrays bigArrays, IndexService indexService) {
this.bigArrays = bigArrays.withCircuitBreaking();
this.indexService = indexService;
this.indexFieldDataService = indexService.fieldData();
this.fixedBitSetFilterCache = indexService.cache().bitsetFilterCache();
this.threadPool = threadPool;
this.indexShard = indexService.getShardOrNull(0);
queryShardContext = indexService.newQueryShardContext(0, null, () -> 0L);
}
示例5: testGetForFieldDefaults
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public void testGetForFieldDefaults() {
final IndexService indexService = createIndex("test");
final IndexFieldDataService ifdService = indexService.fieldData();
final BuilderContext ctx = new BuilderContext(indexService.getIndexSettings().getSettings(), new ContentPath(1));
final MappedFieldType stringMapper = new KeywordFieldMapper.Builder("string").build(ctx).fieldType();
ifdService.clear();
IndexFieldData<?> fd = ifdService.getForField(stringMapper);
assertTrue(fd instanceof SortedSetDVOrdinalsIndexFieldData);
for (MappedFieldType mapper : Arrays.asList(
new NumberFieldMapper.Builder("int", NumberFieldMapper.NumberType.BYTE).build(ctx).fieldType(),
new NumberFieldMapper.Builder("int", NumberFieldMapper.NumberType.SHORT).build(ctx).fieldType(),
new NumberFieldMapper.Builder("int", NumberFieldMapper.NumberType.INTEGER).build(ctx).fieldType(),
new NumberFieldMapper.Builder("long", NumberFieldMapper.NumberType.LONG).build(ctx).fieldType()
)) {
ifdService.clear();
fd = ifdService.getForField(mapper);
assertTrue(fd instanceof SortedNumericDVIndexFieldData);
}
final MappedFieldType floatMapper = new NumberFieldMapper.Builder("float", NumberFieldMapper.NumberType.FLOAT)
.build(ctx).fieldType();
ifdService.clear();
fd = ifdService.getForField(floatMapper);
assertTrue(fd instanceof SortedNumericDVIndexFieldData);
final MappedFieldType doubleMapper = new NumberFieldMapper.Builder("double", NumberFieldMapper.NumberType.DOUBLE)
.build(ctx).fieldType();
ifdService.clear();
fd = ifdService.getForField(doubleMapper);
assertTrue(fd instanceof SortedNumericDVIndexFieldData);
}
示例6: newIndexShard
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public static final IndexShard newIndexShard(IndexService indexService, IndexShard shard, IndexSearcherWrapper wrapper,
IndexingOperationListener... listeners) throws IOException {
ShardRouting initializingShardRouting = getInitializingShardRouting(shard.routingEntry());
IndexShard newShard = new IndexShard(initializingShardRouting, indexService.getIndexSettings(), shard.shardPath(),
shard.store(), indexService.cache(), indexService.mapperService(), indexService.similarityService(),
indexService.fieldData(), shard.getEngineFactory(), indexService.getIndexEventListener(), wrapper,
indexService.getThreadPool(), indexService.getBigArrays(), null, () -> {}, Collections.emptyList(), Arrays.asList(listeners));
return newShard;
}
示例7: createCollector
import org.elasticsearch.index.IndexService; //导入方法依赖的package包/类
public FetchCollector createCollector(int readerId) {
IndexService indexService = fetchContext.indexService(readerId);
LuceneReferenceResolver resolver = new LuceneReferenceResolver(indexService.mapperService());
ArrayList<LuceneCollectorExpression<?>> exprs = new ArrayList<>(refs.size());
for (Reference reference : refs) {
exprs.add(resolver.getImplementation(reference.info()));
}
return new FetchCollector(exprs,
indexService.mapperService(),
fetchContext.searcher(readerId),
indexService.fieldData(),
readerId
);
}