private void loadQueries(String indexName) { IndexService indexService = percolatorIndexService(); IndexShard shard = indexService.shard(0); Engine.Searcher searcher = shard.searcher(); try { // create a query to fetch all queries that are registered under the index name (which is the // type // in the percolator). Query query = new DeletionAwareConstantScoreQuery(indexQueriesFilter(indexName)); QueriesLoaderCollector queries = new QueriesLoaderCollector(); searcher.searcher().search(query, queries); percolator.addQueries(queries.queries()); } catch (IOException e) { throw new PercolatorException(index, "failed to load queries from percolator index"); } finally { searcher.release(); } }
public PercolatorExecutor.Response percolate(PercolatorExecutor.SourceRequest request) throws PercolatorException { return percolator.percolate(request); }