当前位置: 首页>>代码示例>>Java>>正文


Java PercolatorService类代码示例

本文整理汇总了Java中org.elasticsearch.percolator.PercolatorService的典型用法代码示例。如果您正苦于以下问题:Java PercolatorService类的具体用法?Java PercolatorService怎么用?Java PercolatorService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PercolatorService类属于org.elasticsearch.percolator包,在下文中一共展示了PercolatorService类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadQueries

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
private int loadQueries(IndexShard shard) {
    shard.refresh("percolator_load_queries");
    // NOTE: we acquire the searcher via the engine directly here since this is executed right
    // before the shard is marked as POST_RECOVERY
    try (Engine.Searcher searcher = shard.engine().acquireSearcher("percolator_load_queries")) {
        Query query = new TermQuery(new Term(TypeFieldMapper.NAME, PercolatorService.TYPE_NAME));
        QueriesLoaderCollector queryCollector = new QueriesLoaderCollector(PercolatorQueriesRegistry.this, logger, mapperService, indexFieldDataService);
        IndexSearcher indexSearcher = new IndexSearcher(searcher.reader());
        indexSearcher.setQueryCache(null);
        indexSearcher.search(query, queryCollector);
        Map<BytesRef, Query> queries = queryCollector.queries();
        for (Map.Entry<BytesRef, Query> entry : queries.entrySet()) {
            Query previousQuery = percolateQueries.put(entry.getKey(), entry.getValue());
            shardPercolateService.addedQuery(entry.getKey(), previousQuery, entry.getValue());
        }
        return queries.size();
    } catch (Exception e) {
        throw new PercolatorException(shardId.index(), "failed to load queries from percolator index", e);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:PercolatorQueriesRegistry.java

示例2: preCreate

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public Engine.Create preCreate(Engine.Create create) {
    // validate the query here, before we index
    if (PercolatorService.TYPE_NAME.equals(create.type())) {
        parsePercolatorDocument(create.id(), create.source());
    }
    return create;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:PercolatorQueriesRegistry.java

示例3: postCreateUnderLock

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public void postCreateUnderLock(Engine.Create create) {
    // add the query under a doc lock
    if (PercolatorService.TYPE_NAME.equals(create.type())) {
        addPercolateQuery(create.id(), create.source());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PercolatorQueriesRegistry.java

示例4: preIndex

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public Engine.Index preIndex(Engine.Index index) {
    // validate the query here, before we index
    if (PercolatorService.TYPE_NAME.equals(index.type())) {
        parsePercolatorDocument(index.id(), index.source());
    }
    return index;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:PercolatorQueriesRegistry.java

示例5: postIndexUnderLock

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public void postIndexUnderLock(Engine.Index index) {
    // add the query under a doc lock
    if (PercolatorService.TYPE_NAME.equals(index.type())) {
        addPercolateQuery(index.id(), index.source());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PercolatorQueriesRegistry.java

示例6: postDeleteUnderLock

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public void postDeleteUnderLock(Engine.Delete delete) {
    // remove the query under a lock
    if (PercolatorService.TYPE_NAME.equals(delete.type())) {
        removePercolateQuery(delete.id());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:PercolatorQueriesRegistry.java

示例7: parse

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
public DocumentMapper parse(String mappingType, CompressedXContent mappingSource, boolean applyDefault) throws MapperParsingException {
    String defaultMappingSource;
    if (PercolatorService.TYPE_NAME.equals(mappingType)) {
        defaultMappingSource = this.defaultPercolatorMappingSource;
    }  else {
        defaultMappingSource = this.defaultMappingSource;
    }
    return documentParser.parse(mappingType, mappingSource, applyDefault ? defaultMappingSource : null);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:MapperService.java

示例8: TransportPercolateAction

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Inject
public TransportPercolateAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                TransportService transportService, PercolatorService percolatorService,
                                TransportGetAction getAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, PercolateAction.NAME, threadPool, clusterService, transportService, actionFilters,
            indexNameExpressionResolver, PercolateRequest.class, PercolateShardRequest.class, ThreadPool.Names.PERCOLATE);
    this.percolatorService = percolatorService;
    this.getAction = getAction;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:10,代码来源:TransportPercolateAction.java

示例9: TransportMultiPercolateAction

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Inject
public TransportMultiPercolateAction(Settings settings, ThreadPool threadPool, TransportShardMultiPercolateAction shardMultiPercolateAction,
                                     ClusterService clusterService, TransportService transportService, PercolatorService percolatorService,
                                     TransportMultiGetAction multiGetAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, MultiPercolateAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiPercolateRequest.class);
    this.shardMultiPercolateAction = shardMultiPercolateAction;
    this.clusterService = clusterService;
    this.percolatorService = percolatorService;
    this.multiGetAction = multiGetAction;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:TransportMultiPercolateAction.java

示例10: TransportShardMultiPercolateAction

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Inject
public TransportShardMultiPercolateAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
                                          TransportService transportService, PercolatorService percolatorService,
                                          ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
    super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
            Request.class, ThreadPool.Names.PERCOLATE);
    this.percolatorService = percolatorService;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:TransportShardMultiPercolateAction.java

示例11: beforeCreate

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
@Override
public void beforeCreate(DocumentMapper mapper) {
    if (PercolatorService.TYPE_NAME.equals(mapper.type())) {
        enableRealTimePercolator();
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:7,代码来源:PercolatorQueriesRegistry.java

示例12: hasPercolatorType

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
private boolean hasPercolatorType(IndexShard indexShard) {
    ShardId otherShardId = indexShard.shardId();
    return shardId.equals(otherShardId) && mapperService.hasMapping(PercolatorService.TYPE_NAME);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:PercolatorQueriesRegistry.java

示例13: typeNameStartsWithIllegalDot

import org.elasticsearch.percolator.PercolatorService; //导入依赖的package包/类
private boolean typeNameStartsWithIllegalDot(DocumentMapper mapper) {
    return mapper.type().startsWith(".") && !PercolatorService.TYPE_NAME.equals(mapper.type());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:4,代码来源:MapperService.java


注:本文中的org.elasticsearch.percolator.PercolatorService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。