Class SubSearchContext
java.lang.Object
org.elasticsearch.search.internal.SearchContext
org.elasticsearch.search.internal.FilteredSearchContext
org.elasticsearch.search.internal.SubSearchContext
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
InnerHitsContext.InnerHitSubContext
-
Field Summary
Fields inherited from class org.elasticsearch.search.internal.SearchContext
DEFAULT_TERMINATE_AFTER, DEFAULT_TRACK_TOTAL_HITS_UP_TO, releasables, TRACK_TOTAL_HITS_ACCURATE, TRACK_TOTAL_HITS_DISABLED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaggregations(SearchContextAggregations aggregations)
org.apache.lucene.search.Query
buildFilteredQuery(org.apache.lucene.search.Query query)
Automatically apply all required filters to the given query such as alias filters, types filters, etc.collapse()
int[]
docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadSize)
int
docValuesContext(FetchDocValuesContext docValuesContext)
boolean
explain()
void
explain(boolean explain)
The context related to retrieving fields.fetchFieldsContext(FetchFieldsContext fetchFieldsContext)
Sets the context related to retrieving fields.fetchSourceContext(FetchSourceContext fetchSourceContext)
int
from()
from(int from)
long
Returns time in milliseconds that can be used for relative time calculations.void
groupStats(List<String> groupStats)
boolean
boolean
boolean
void
highlight(SearchHighlightContext highlight)
minimumScore(float minimumScore)
parsedPostFilter(ParsedQuery postFilter)
parsedQuery(ParsedQuery parsedQuery)
void
preProcess(boolean rewrite)
Should be called before executing the main query and after all other parameters have been set.org.apache.lucene.search.Query
query()
The query to execute, might be rewritten.boolean
indicates whether the sequence number and primary term of the last modification to each hit should be returnedvoid
seqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm)
controls whether the sequence number and primary term of the last modification to each hit should be returnedint
size()
size(int size)
sort()
sort(SortAndFormats sort)
boolean
A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.storedFieldsContext(StoredFieldsContext storedFieldsContext)
void
suggest(SuggestionSearchContext suggest)
void
terminateAfter(int terminateAfter)
void
timeout(org.elasticsearch.core.TimeValue timeout)
boolean
trackScores(boolean trackScores)
boolean
version()
void
version(boolean version)
Methods inherited from class org.elasticsearch.search.internal.FilteredSearchContext
addRescore, addSearchExt, aggregations, bitsetFilterCache, collapse, dfsResult, fetchPhase, getProfilers, getSearchExecutionContext, getSearchExt, getTask, groupStats, id, indexShard, innerHits, isCancelled, lowLevelCancellation, minimumScore, numberOfShards, parsedPostFilter, queryCollectors, readerContext, request, rescore, scrollContext, searchAfter, searchAfter, searcher, searchType, setTask, shardTarget, source, suggest, terminateAfter, timeout, trackTotalHitsUpTo, trackTotalHitsUpTo
Methods inherited from class org.elasticsearch.search.internal.SearchContext
addReleasable, assignRescoreDocIds, close, hasOnlySuggest, rescoreDocIds, toString
-
Constructor Details
-
SubSearchContext
-
-
Method Details
-
preProcess
public void preProcess(boolean rewrite)Description copied from class:SearchContext
Should be called before executing the main query and after all other parameters have been set.- Overrides:
preProcess
in 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:SearchContext
Automatically apply all required filters to the given query such as alias filters, types filters, etc.- Overrides:
buildFilteredQuery
in classFilteredSearchContext
-
aggregations
- Overrides:
aggregations
in classFilteredSearchContext
-
highlight
- Overrides:
highlight
in classFilteredSearchContext
-
highlight
- Overrides:
highlight
in classFilteredSearchContext
-
suggest
- Overrides:
suggest
in classFilteredSearchContext
-
hasScriptFields
public boolean hasScriptFields()- Overrides:
hasScriptFields
in classFilteredSearchContext
-
scriptFields
- Overrides:
scriptFields
in classFilteredSearchContext
-
sourceRequested
public boolean sourceRequested()Description copied from class:SearchContext
A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.- Overrides:
sourceRequested
in classFilteredSearchContext
-
hasFetchSourceContext
public boolean hasFetchSourceContext()- Overrides:
hasFetchSourceContext
in classFilteredSearchContext
-
fetchSourceContext
- Overrides:
fetchSourceContext
in classFilteredSearchContext
-
fetchSourceContext
- Overrides:
fetchSourceContext
in classFilteredSearchContext
-
docValuesContext
- Specified by:
docValuesContext
in classSearchContext
-
docValuesContext
- Specified by:
docValuesContext
in classSearchContext
-
fetchFieldsContext
Description copied from class:SearchContext
The context related to retrieving fields.- Specified by:
fetchFieldsContext
in classSearchContext
-
fetchFieldsContext
Description copied from class:SearchContext
Sets the context related to retrieving fields.- Specified by:
fetchFieldsContext
in classSearchContext
-
timeout
public void timeout(org.elasticsearch.core.TimeValue timeout)- Overrides:
timeout
in classFilteredSearchContext
-
terminateAfter
public void terminateAfter(int terminateAfter)- Overrides:
terminateAfter
in classFilteredSearchContext
-
minimumScore
- Overrides:
minimumScore
in classFilteredSearchContext
-
sort
- Overrides:
sort
in classFilteredSearchContext
-
sort
- Overrides:
sort
in classFilteredSearchContext
-
parsedQuery
- Overrides:
parsedQuery
in classFilteredSearchContext
-
parsedQuery
- Overrides:
parsedQuery
in classFilteredSearchContext
-
query
public org.apache.lucene.search.Query query()Description copied from class:SearchContext
The query to execute, might be rewritten.- Overrides:
query
in classFilteredSearchContext
-
trackScores
- Overrides:
trackScores
in classFilteredSearchContext
-
trackScores
public boolean trackScores()- Overrides:
trackScores
in classFilteredSearchContext
-
parsedPostFilter
- Overrides:
parsedPostFilter
in classFilteredSearchContext
-
from
public int from()- Overrides:
from
in classFilteredSearchContext
-
from
- Overrides:
from
in classFilteredSearchContext
-
size
public int size()- Overrides:
size
in classFilteredSearchContext
-
size
- Overrides:
size
in classFilteredSearchContext
-
hasStoredFields
public boolean hasStoredFields()- Overrides:
hasStoredFields
in classFilteredSearchContext
-
storedFieldsContext
- Overrides:
storedFieldsContext
in classFilteredSearchContext
-
storedFieldsContext
- Overrides:
storedFieldsContext
in classFilteredSearchContext
-
explain
public boolean explain()- Overrides:
explain
in classFilteredSearchContext
-
explain
public void explain(boolean explain)- Overrides:
explain
in classFilteredSearchContext
-
groupStats
- Overrides:
groupStats
in classFilteredSearchContext
-
version
public boolean version()- Overrides:
version
in classFilteredSearchContext
-
version
public void version(boolean version)- Overrides:
version
in classFilteredSearchContext
-
seqNoAndPrimaryTerm
public boolean seqNoAndPrimaryTerm()Description copied from class:SearchContext
indicates whether the sequence number and primary term of the last modification to each hit should be returned- Overrides:
seqNoAndPrimaryTerm
in classFilteredSearchContext
-
seqNoAndPrimaryTerm
public void seqNoAndPrimaryTerm(boolean seqNoAndPrimaryTerm)Description copied from class:SearchContext
controls whether the sequence number and primary term of the last modification to each hit should be returned- Overrides:
seqNoAndPrimaryTerm
in classFilteredSearchContext
-
docIdsToLoad
public int[] docIdsToLoad()- Overrides:
docIdsToLoad
in classFilteredSearchContext
-
docIdsToLoadSize
public int docIdsToLoadSize()- Specified by:
docIdsToLoadSize
in classSearchContext
-
docIdsToLoad
- Overrides:
docIdsToLoad
in classFilteredSearchContext
-
collapse
- Overrides:
collapse
in classFilteredSearchContext
-
queryResult
- Overrides:
queryResult
in classFilteredSearchContext
-
fetchResult
- Overrides:
fetchResult
in classFilteredSearchContext
-
getRelativeTimeInMillis
public long getRelativeTimeInMillis()Description copied from class:SearchContext
Returns time in milliseconds that can be used for relative time calculations. WARN: This is not the epoch time.- Overrides:
getRelativeTimeInMillis
in classFilteredSearchContext
-