Class SubSearchContext
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.AbstractRefCounted
-
- org.elasticsearch.search.internal.SearchContext
-
- org.elasticsearch.search.internal.FilteredSearchContext
-
- org.elasticsearch.search.internal.SubSearchContext
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable,RefCounted
- Direct Known Subclasses:
InnerHitsContext.InnerHitSubContext
public class SubSearchContext extends FilteredSearchContext
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.internal.SearchContext
SearchContext.Lifetime
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.internal.SearchContext
DEFAULT_TERMINATE_AFTER
-
-
Constructor Summary
Constructors Constructor Description SubSearchContext(SearchContext context)
-
Method Summary
Modifier and Type Method Description voidaccessed(long accessTime)voidaddRescore(RescoreContext rescore)SearchContextaggregations(SearchContextAggregations aggregations)org.apache.lucene.search.QuerybuildFilteredQuery(org.apache.lucene.search.Query query)Automatically apply all required filters to the given query such as alias filters, types filters, etc.CollapseContextcollapse()int[]docIdsToLoad()SearchContextdocIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadFrom, int docsIdsToLoadSize)intdocIdsToLoadFrom()intdocIdsToLoadSize()protected voiddoClose()DocValueFieldsContextdocValueFieldsContext()SearchContextdocValueFieldsContext(DocValueFieldsContext docValueFieldsContext)booleanexplain()voidexplain(boolean explain)FetchSearchResultfetchResult()FetchSourceContextfetchSourceContext()SearchContextfetchSourceContext(FetchSourceContext fetchSourceContext)intfrom()SearchContextfrom(int from)voidgroupStats(java.util.List<java.lang.String> groupStats)booleanhasFetchSourceContext()booleanhasScriptFields()booleanhasStoredFields()booleanhasStoredFieldsContext()SearchContextHighlighthighlight()voidhighlight(SearchContextHighlight highlight)voidkeepAlive(long keepAlive)SearchContextminimumScore(float minimumScore)SearchContextparsedPostFilter(ParsedQuery postFilter)ParsedQueryparsedQuery()SearchContextparsedQuery(ParsedQuery parsedQuery)voidpreProcess(boolean rewrite)Should be called before executing the main query and after all other parameters have been set.org.apache.lucene.search.Queryquery()The query to execute, might be rewritten.QuerySearchResultqueryResult()ScriptFieldsContextscriptFields()SearchContextscrollContext(ScrollContext scrollContext)booleanseqNoAndPrimaryTerm()indicates whether the sequence number and primary term of the last modification to each hit should be returnedvoidseqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm)controls whether the sequence number and primary term of the last modification to each hit should be returnedintsize()SearchContextsize(int size)SortAndFormatssort()SearchContextsort(SortAndFormats sort)booleansourceRequested()A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.StoredFieldsContextstoredFieldsContext()SearchContextstoredFieldsContext(StoredFieldsContext storedFieldsContext)booleanstoredFieldsRequested()A shortcut function to see whether there is a storedFieldsContext and it says the fields are requested.voidsuggest(SuggestionSearchContext suggest)voidterminateAfter(int terminateAfter)org.apache.lucene.util.CountertimeEstimateCounter()voidtimeout(TimeValue timeout)booleantrackScores()SearchContexttrackScores(boolean trackScores)booleanversion()voidversion(boolean version)-
Methods inherited from class org.elasticsearch.search.internal.FilteredSearchContext
addSearchExt, aggregations, aliasFilter, bigArrays, bitsetFilterCache, collapse, dfsResult, fetchPhase, getForField, getObjectMapper, getOriginNanoTime, getProfilers, getQueryShardContext, getSearchExt, getTask, groupStats, id, indexShard, innerHits, isCancelled, keepAlive, lastAccessTime, lookup, lowLevelCancellation, mapperService, minimumScore, numberOfShards, parsedPostFilter, queryBoost, queryCollectors, request, rescore, scrollContext, searchAfter, searchAfter, searcher, searchType, setTask, shardTarget, similarityService, smartNameFieldType, source, suggest, terminateAfter, timeout, trackTotalHits, trackTotalHits
-
Methods inherited from class org.elasticsearch.search.internal.SearchContext
addReleasable, alreadyClosed, clearReleasables, close, closeInternal, hasOnlySuggest, toString
-
-
-
-
Constructor Detail
-
SubSearchContext
public SubSearchContext(SearchContext context)
-
-
Method Detail
-
doClose
protected void doClose()
- Overrides:
doClosein classFilteredSearchContext
-
preProcess
public void preProcess(boolean rewrite)
Description copied from class:SearchContextShould be called before executing the main query and after all other parameters have been set.- Overrides:
preProcessin classFilteredSearchContext- Parameters:
rewrite- if the set query should be rewritten against the searcher returned fromSearchContext.searcher()
-
buildFilteredQuery
public org.apache.lucene.search.Query buildFilteredQuery(org.apache.lucene.search.Query query)
Description copied from class:SearchContextAutomatically apply all required filters to the given query such as alias filters, types filters, etc.- Overrides:
buildFilteredQueryin classFilteredSearchContext
-
scrollContext
public SearchContext scrollContext(ScrollContext scrollContext)
- Overrides:
scrollContextin classFilteredSearchContext
-
aggregations
public SearchContext aggregations(SearchContextAggregations aggregations)
- Overrides:
aggregationsin classFilteredSearchContext
-
highlight
public SearchContextHighlight highlight()
- Overrides:
highlightin classFilteredSearchContext
-
highlight
public void highlight(SearchContextHighlight highlight)
- Overrides:
highlightin classFilteredSearchContext
-
suggest
public void suggest(SuggestionSearchContext suggest)
- Overrides:
suggestin classFilteredSearchContext
-
addRescore
public void addRescore(RescoreContext rescore)
- Overrides:
addRescorein classFilteredSearchContext
-
hasScriptFields
public boolean hasScriptFields()
- Overrides:
hasScriptFieldsin classFilteredSearchContext
-
scriptFields
public ScriptFieldsContext scriptFields()
- Overrides:
scriptFieldsin classFilteredSearchContext
-
sourceRequested
public boolean sourceRequested()
Description copied from class:SearchContextA shortcut function to see whether there is a fetchSourceContext and it says the source is requested.- Overrides:
sourceRequestedin classFilteredSearchContext
-
hasFetchSourceContext
public boolean hasFetchSourceContext()
- Overrides:
hasFetchSourceContextin classFilteredSearchContext
-
fetchSourceContext
public FetchSourceContext fetchSourceContext()
- Overrides:
fetchSourceContextin classFilteredSearchContext
-
fetchSourceContext
public SearchContext fetchSourceContext(FetchSourceContext fetchSourceContext)
- Overrides:
fetchSourceContextin classFilteredSearchContext
-
docValueFieldsContext
public DocValueFieldsContext docValueFieldsContext()
- Specified by:
docValueFieldsContextin classSearchContext
-
docValueFieldsContext
public SearchContext docValueFieldsContext(DocValueFieldsContext docValueFieldsContext)
- Specified by:
docValueFieldsContextin classSearchContext
-
timeout
public void timeout(TimeValue timeout)
- Overrides:
timeoutin classFilteredSearchContext
-
terminateAfter
public void terminateAfter(int terminateAfter)
- Overrides:
terminateAfterin classFilteredSearchContext
-
minimumScore
public SearchContext minimumScore(float minimumScore)
- Overrides:
minimumScorein classFilteredSearchContext
-
sort
public SearchContext sort(SortAndFormats sort)
- Overrides:
sortin classFilteredSearchContext
-
sort
public SortAndFormats sort()
- Overrides:
sortin classFilteredSearchContext
-
parsedQuery
public SearchContext parsedQuery(ParsedQuery parsedQuery)
- Overrides:
parsedQueryin classFilteredSearchContext
-
parsedQuery
public ParsedQuery parsedQuery()
- Overrides:
parsedQueryin classFilteredSearchContext
-
query
public org.apache.lucene.search.Query query()
Description copied from class:SearchContextThe query to execute, might be rewritten.- Overrides:
queryin classFilteredSearchContext
-
trackScores
public SearchContext trackScores(boolean trackScores)
- Overrides:
trackScoresin classFilteredSearchContext
-
trackScores
public boolean trackScores()
- Overrides:
trackScoresin classFilteredSearchContext
-
parsedPostFilter
public SearchContext parsedPostFilter(ParsedQuery postFilter)
- Overrides:
parsedPostFilterin classFilteredSearchContext
-
from
public int from()
- Overrides:
fromin classFilteredSearchContext
-
from
public SearchContext from(int from)
- Overrides:
fromin classFilteredSearchContext
-
size
public int size()
- Overrides:
sizein classFilteredSearchContext
-
size
public SearchContext size(int size)
- Overrides:
sizein classFilteredSearchContext
-
hasStoredFields
public boolean hasStoredFields()
- Overrides:
hasStoredFieldsin classFilteredSearchContext
-
hasStoredFieldsContext
public boolean hasStoredFieldsContext()
- Overrides:
hasStoredFieldsContextin classFilteredSearchContext
-
storedFieldsRequested
public boolean storedFieldsRequested()
Description copied from class:SearchContextA shortcut function to see whether there is a storedFieldsContext and it says the fields are requested.- Overrides:
storedFieldsRequestedin classFilteredSearchContext
-
storedFieldsContext
public StoredFieldsContext storedFieldsContext()
- Overrides:
storedFieldsContextin classFilteredSearchContext
-
storedFieldsContext
public SearchContext storedFieldsContext(StoredFieldsContext storedFieldsContext)
- Overrides:
storedFieldsContextin classFilteredSearchContext
-
explain
public boolean explain()
- Overrides:
explainin classFilteredSearchContext
-
explain
public void explain(boolean explain)
- Overrides:
explainin classFilteredSearchContext
-
groupStats
public void groupStats(java.util.List<java.lang.String> groupStats)
- Overrides:
groupStatsin classFilteredSearchContext
-
version
public boolean version()
- Overrides:
versionin classFilteredSearchContext
-
version
public void version(boolean version)
- Overrides:
versionin classFilteredSearchContext
-
seqNoAndPrimaryTerm
public boolean seqNoAndPrimaryTerm()
Description copied from class:SearchContextindicates whether the sequence number and primary term of the last modification to each hit should be returned- Overrides:
seqNoAndPrimaryTermin classFilteredSearchContext
-
seqNoAndPrimaryTerm
public void seqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm)
Description copied from class:SearchContextcontrols whether the sequence number and primary term of the last modification to each hit should be returned- Overrides:
seqNoAndPrimaryTermin classFilteredSearchContext
-
docIdsToLoad
public int[] docIdsToLoad()
- Overrides:
docIdsToLoadin classFilteredSearchContext
-
docIdsToLoadFrom
public int docIdsToLoadFrom()
- Overrides:
docIdsToLoadFromin classFilteredSearchContext
-
docIdsToLoadSize
public int docIdsToLoadSize()
- Overrides:
docIdsToLoadSizein classFilteredSearchContext
-
docIdsToLoad
public SearchContext docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadFrom, int docsIdsToLoadSize)
- Overrides:
docIdsToLoadin classFilteredSearchContext
-
collapse
public CollapseContext collapse()
- Overrides:
collapsein classFilteredSearchContext
-
accessed
public void accessed(long accessTime)
- Overrides:
accessedin classFilteredSearchContext
-
keepAlive
public void keepAlive(long keepAlive)
- Overrides:
keepAlivein classFilteredSearchContext
-
queryResult
public QuerySearchResult queryResult()
- Overrides:
queryResultin classFilteredSearchContext
-
fetchResult
public FetchSearchResult fetchResult()
- Overrides:
fetchResultin classFilteredSearchContext
-
timeEstimateCounter
public org.apache.lucene.util.Counter timeEstimateCounter()
- Overrides:
timeEstimateCounterin classFilteredSearchContext
-
-