Package org.elasticsearch.search.fetch
Class FetchContext
java.lang.Object
org.elasticsearch.search.fetch.FetchContext
public class FetchContext
extends java.lang.Object
Encapsulates state required to execute fetch phases
-
Constructor Summary
Constructors Constructor Description FetchContext(SearchContext searchContext)Create a FetchContext based on a SearchContext -
Method Summary
Modifier and Type Method Description booleancontainsBrokenAnalysis(java.lang.String field)Does the index analyzer for this field have token filters that may produce backwards offsets in term vectorsFetchDocValuesContextdocValuesContext()Configuration for fetching docValues fieldsbooleanexplain()Should the response include `explain` outputFetchFieldsContextfetchFieldsContext()Configuration for the 'fields' responsebooleanfetchScores()Should the response include scores, even if scores were not calculated in the original queryFetchSourceContextfetchSourceContext()Configuration for fetching _sourcejava.lang.StringgetIndexName()The name of the index that documents are being fetched fromQueryShardContextgetQueryShardContext()SourceLookupgetRootSourceLookup(FetchSubPhase.HitContext hitContext)For a hit document that's being processed, return the source lookup representing the root document.SearchExtBuildergetSearchExt(java.lang.String name)Configuration for external fetch phase pluginsSearchHighlightContexthighlight()Configuration for highlightingInnerHitsContextinnerHits()Configuration for returning inner hitsParsedQueryparsedPostFilter()Any post-filters run as part of the searchParsedQueryparsedQuery()The original query with additional filters and named queriesorg.apache.lucene.search.Queryquery()The original queryjava.util.List<RescoreContext>rescore()The rescorers included in the original search, used for explain outputScriptFieldsContextscriptFields()Configuration for script fieldsContextIndexSearchersearcher()The point-in-time searcher the original query was executed againstSearchLookupsearchLookup()TheSearchLookupfor the this contextbooleanseqNoAndPrimaryTerm()Should the response include sequence number and primary term metadatabooleanversion()Should the response include version metadata
-
Constructor Details
-
FetchContext
Create a FetchContext based on a SearchContext
-
-
Method Details
-
getIndexName
public java.lang.String getIndexName()The name of the index that documents are being fetched from -
searcher
The point-in-time searcher the original query was executed against -
searchLookup
TheSearchLookupfor the this context -
query
public org.apache.lucene.search.Query query()The original query -
parsedQuery
The original query with additional filters and named queries -
parsedPostFilter
Any post-filters run as part of the search -
fetchSourceContext
Configuration for fetching _source -
explain
public boolean explain()Should the response include `explain` output -
rescore
The rescorers included in the original search, used for explain output -
seqNoAndPrimaryTerm
public boolean seqNoAndPrimaryTerm()Should the response include sequence number and primary term metadata -
docValuesContext
Configuration for fetching docValues fields -
highlight
Configuration for highlighting -
containsBrokenAnalysis
public boolean containsBrokenAnalysis(java.lang.String field)Does the index analyzer for this field have token filters that may produce backwards offsets in term vectors -
fetchScores
public boolean fetchScores()Should the response include scores, even if scores were not calculated in the original query -
innerHits
Configuration for returning inner hits -
version
public boolean version()Should the response include version metadata -
fetchFieldsContext
Configuration for the 'fields' response -
scriptFields
Configuration for script fields -
getSearchExt
Configuration for external fetch phase plugins -
getQueryShardContext
-
getRootSourceLookup
For a hit document that's being processed, return the source lookup representing the root document. This method is used to pass down the root source when processing this document's nested inner hits.- Parameters:
hitContext- The context of the hit that's being processed.
-