public class SearchPhaseController extends AbstractComponent
deprecationLogger, logger, settings
Constructor and Description |
---|
SearchPhaseController(Settings settings,
BigArrays bigArrays,
ScriptService scriptService) |
Modifier and Type | Method and Description |
---|---|
AggregatedDfs |
aggregateDfs(AtomicArray<DfsSearchResult> results) |
com.carrotsearch.hppc.IntArrayList[] |
fillDocIdsToLoad(int numShards,
org.apache.lucene.search.ScoreDoc[] shardDocs)
Builds an array, with potential null elements, with docs to load.
|
org.apache.lucene.search.ScoreDoc[] |
getLastEmittedDocPerShard(java.util.List<? extends AtomicArray.Entry<? extends QuerySearchResultProvider>> queryResults,
org.apache.lucene.search.ScoreDoc[] sortedScoreDocs,
int numShards) |
InternalSearchResponse |
merge(boolean ignoreFrom,
org.apache.lucene.search.ScoreDoc[] sortedDocs,
AtomicArray<? extends QuerySearchResultProvider> queryResultsArr,
AtomicArray<? extends QuerySearchResultProvider> fetchResultsArr)
Enriches search hits and completion suggestion hits from
sortedDocs using fetchResultsArr ,
merges suggestions, aggregations and profile results
Expects sortedDocs to have top search docs across all shards, optionally followed by top suggest docs for each named
completion suggestion ordered by suggestion name |
org.apache.lucene.search.ScoreDoc[] |
sortDocs(boolean ignoreFrom,
AtomicArray<? extends QuerySearchResultProvider> resultsArr)
Returns a score doc array of top N search docs across all shards, followed by top suggest docs for each
named completion suggestion across all shards.
|
logDeprecatedSetting, logRemovedSetting, nodeName
public SearchPhaseController(Settings settings, BigArrays bigArrays, ScriptService scriptService)
public AggregatedDfs aggregateDfs(AtomicArray<DfsSearchResult> results)
public org.apache.lucene.search.ScoreDoc[] sortDocs(boolean ignoreFrom, AtomicArray<? extends QuerySearchResultProvider> resultsArr) throws java.io.IOException
ignoreFrom
- Whether to ignore the from and sort all hits in each shard result.
Enabled only for scroll search, because that only retrieves hits of length 'size' in the query phase.resultsArr
- Shard result holderjava.io.IOException
public org.apache.lucene.search.ScoreDoc[] getLastEmittedDocPerShard(java.util.List<? extends AtomicArray.Entry<? extends QuerySearchResultProvider>> queryResults, org.apache.lucene.search.ScoreDoc[] sortedScoreDocs, int numShards)
public com.carrotsearch.hppc.IntArrayList[] fillDocIdsToLoad(int numShards, org.apache.lucene.search.ScoreDoc[] shardDocs)
public InternalSearchResponse merge(boolean ignoreFrom, org.apache.lucene.search.ScoreDoc[] sortedDocs, AtomicArray<? extends QuerySearchResultProvider> queryResultsArr, AtomicArray<? extends QuerySearchResultProvider> fetchResultsArr)
sortedDocs
using fetchResultsArr
,
merges suggestions, aggregations and profile results
Expects sortedDocs to have top search docs across all shards, optionally followed by top suggest docs for each named
completion suggestion ordered by suggestion name