Class SubSearchContext
java.lang.Object
org.elasticsearch.search.internal.SearchContext
org.elasticsearch.search.internal.FilteredSearchContext
org.elasticsearch.search.internal.SubSearchContext
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.elasticsearch.common.lease.Releasable
- Direct Known Subclasses:
InnerHitsContext.InnerHitSubContext
public class SubSearchContext extends FilteredSearchContext
-
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
Constructors Constructor Description SubSearchContext(SearchContext context)
-
Method Summary
Modifier and Type Method Description SearchContext
aggregations(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.CollapseContext
collapse()
int[]
docIdsToLoad()
SearchContext
docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadSize)
int
docIdsToLoadSize()
FetchDocValuesContext
docValuesContext()
SearchContext
docValuesContext(FetchDocValuesContext docValuesContext)
boolean
explain()
void
explain(boolean explain)
FetchFieldsContext
fetchFieldsContext()
The context related to retrieving fields.SubSearchContext
fetchFieldsContext(FetchFieldsContext fetchFieldsContext)
Sets the context related to retrieving fields.FetchSearchResult
fetchResult()
FetchSourceContext
fetchSourceContext()
SearchContext
fetchSourceContext(FetchSourceContext fetchSourceContext)
int
from()
SearchContext
from(int from)
long
getRelativeTimeInMillis()
Returns time in milliseconds that can be used for relative time calculations.void
groupStats(java.util.List<java.lang.String> groupStats)
boolean
hasFetchSourceContext()
boolean
hasScriptFields()
boolean
hasStoredFields()
SearchHighlightContext
highlight()
void
highlight(SearchHighlightContext highlight)
SearchContext
minimumScore(float minimumScore)
SearchContext
parsedPostFilter(ParsedQuery postFilter)
ParsedQuery
parsedQuery()
SubSearchContext
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.QuerySearchResult
queryResult()
ScriptFieldsContext
scriptFields()
boolean
seqNoAndPrimaryTerm()
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()
SearchContext
size(int size)
SortAndFormats
sort()
SearchContext
sort(SortAndFormats sort)
boolean
sourceRequested()
A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.StoredFieldsContext
storedFieldsContext()
SearchContext
storedFieldsContext(StoredFieldsContext storedFieldsContext)
void
suggest(SuggestionSearchContext suggest)
void
terminateAfter(int terminateAfter)
void
timeout(org.elasticsearch.common.unit.TimeValue timeout)
boolean
trackScores()
SearchContext
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.common.unit.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
public void groupStats(java.util.List<java.lang.String> 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
-