java.lang.Object
org.elasticsearch.search.internal.SearchContext
org.elasticsearch.search.internal.FilteredSearchContext
org.elasticsearch.search.internal.SubSearchContext
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable
- Direct Known Subclasses:
InnerHitsContext.InnerHitSubContext
-
Field Summary
Fields inherited from class org.elasticsearch.search.internal.SearchContext
closeFuture, DEFAULT_TERMINATE_AFTER, DEFAULT_TRACK_TOTAL_HITS_UP_TO, TRACK_TOTAL_HITS_ACCURATE, TRACK_TOTAL_HITS_DISABLED -
Constructor Summary
ConstructorsConstructorDescriptionSubSearchContext(SearchContext context) SubSearchContext(SubSearchContext subSearchContext) -
Method Summary
Modifier and TypeMethodDescriptionaggregations(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.collapse()docValuesContext(FetchDocValuesContext docValuesContext) booleanexplain()voidexplain(boolean explain) The context related to retrieving fields.fetchFieldsContext(FetchFieldsContext fetchFieldsContext) Sets the context related to retrieving fields.fetchSourceContext(FetchSourceContext fetchSourceContext) intfrom()from(int from) floatlongReturns time in milliseconds that can be used for relative time calculations.org.apache.lucene.search.TotalHitsbooleanbooleanvoidhighlight(SearchHighlightContext highlight) minimumScore(float minimumScore) parsedPostFilter(ParsedQuery postFilter) parsedQuery(ParsedQuery parsedQuery) voidShould be called before executing the main query and after all other parameters have been set.org.apache.lucene.search.Queryquery()The query to execute, not rewritten.booleanindicates 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()size(int size) sort()sort(SortAndFormats sort) booleanA shortcut function to see whether there is a fetchSourceContext and it says the source is requested.storedFieldsContext(StoredFieldsContext storedFieldsContext) voidterminateAfter(int terminateAfter) booleantrackScores(boolean trackScores) booleanversion()voidversion(boolean version) Methods inherited from class org.elasticsearch.search.internal.FilteredSearchContext
addDfsResult, addFetchResult, addQueryResult, addRankFeatureResult, addRescore, aggregations, bitsetFilterCache, circuitBreaker, dfsResult, fetchPhase, getProfilers, getSearchExecutionContext, getSearchExt, getTask, groupStats, id, indexShard, innerHits, isCancelled, lowLevelCancellation, memAccountingBufferSize, minimumScore, newIdLoader, newSourceLoader, numberOfShards, parsedPostFilter, queryPhaseRankShardContext, queryPhaseRankShardContext, rankFeatureResult, readerContext, request, rescore, scrollContext, searchAfter, searchAfter, searcher, searchType, setTask, shardTarget, source, suggest, terminateAfter, timeout, trackTotalHitsUpTo, trackTotalHitsUpToMethods inherited from class org.elasticsearch.search.internal.SearchContext
addReleasable, assignRescoreDocIds, checkRealMemoryCB, close, getCancellationChecks, hasOnlySuggest, isClosed, rescoreDocIds, rewrittenQuery, toString
-
Constructor Details
-
SubSearchContext
-
SubSearchContext
-
-
Method Details
-
preProcess
public void preProcess()Description copied from class:SearchContextShould be called before executing the main query and after all other parameters have been set.- Overrides:
preProcessin classFilteredSearchContext
-
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
-
aggregations
- Overrides:
aggregationsin classFilteredSearchContext
-
highlight
- Overrides:
highlightin classFilteredSearchContext
-
highlight
- Overrides:
highlightin classFilteredSearchContext
-
hasScriptFields
public boolean hasScriptFields()- Overrides:
hasScriptFieldsin classFilteredSearchContext
-
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
-
fetchSourceContext
- Overrides:
fetchSourceContextin classFilteredSearchContext
-
fetchSourceContext
- Overrides:
fetchSourceContextin classFilteredSearchContext
-
docValuesContext
- Specified by:
docValuesContextin classSearchContext
-
docValuesContext
- Specified by:
docValuesContextin classSearchContext
-
fetchFieldsContext
Description copied from class:SearchContextThe context related to retrieving fields.- Specified by:
fetchFieldsContextin classSearchContext
-
fetchFieldsContext
Description copied from class:SearchContextSets the context related to retrieving fields.- Specified by:
fetchFieldsContextin classSearchContext
-
terminateAfter
public void terminateAfter(int terminateAfter) - Overrides:
terminateAfterin classFilteredSearchContext
-
minimumScore
- Overrides:
minimumScorein classFilteredSearchContext
-
sort
- Overrides:
sortin classFilteredSearchContext
-
sort
- Overrides:
sortin classFilteredSearchContext
-
parsedQuery
- Overrides:
parsedQueryin classFilteredSearchContext
-
parsedQuery
- Overrides:
parsedQueryin classFilteredSearchContext
-
query
public org.apache.lucene.search.Query query()Description copied from class:SearchContextThe query to execute, not rewritten.- Overrides:
queryin classFilteredSearchContext
-
trackScores
- Overrides:
trackScoresin classFilteredSearchContext
-
trackScores
public boolean trackScores()- Overrides:
trackScoresin classFilteredSearchContext
-
parsedPostFilter
- Overrides:
parsedPostFilterin classFilteredSearchContext
-
from
public int from()- Overrides:
fromin classFilteredSearchContext
-
from
- Overrides:
fromin classFilteredSearchContext
-
size
public int size()- Overrides:
sizein classFilteredSearchContext
-
size
- Overrides:
sizein classFilteredSearchContext
-
hasStoredFields
public boolean hasStoredFields()- Overrides:
hasStoredFieldsin classFilteredSearchContext
-
storedFieldsContext
- Overrides:
storedFieldsContextin classFilteredSearchContext
-
storedFieldsContext
- Overrides:
storedFieldsContextin classFilteredSearchContext
-
explain
public boolean explain()- Overrides:
explainin classFilteredSearchContext
-
explain
public void explain(boolean explain) - Overrides:
explainin 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
-
collapse
- Overrides:
collapsein classFilteredSearchContext
-
queryResult
- Overrides:
queryResultin classFilteredSearchContext
-
fetchResult
- Overrides:
fetchResultin classFilteredSearchContext
-
getRelativeTimeInMillis
public long getRelativeTimeInMillis()Description copied from class:SearchContextReturns time in milliseconds that can be used for relative time calculations. WARN: This is not the epoch time.- Overrides:
getRelativeTimeInMillisin classFilteredSearchContext
-
getTotalHits
public org.apache.lucene.search.TotalHits getTotalHits()- Overrides:
getTotalHitsin classFilteredSearchContext
-
getMaxScore
public float getMaxScore()- Overrides:
getMaxScorein classFilteredSearchContext
-