Package org.elasticsearch.search.fetch
Class FetchContext
java.lang.Object
org.elasticsearch.search.fetch.FetchContext
Encapsulates state required to execute fetch phases
-
Constructor Summary
ConstructorDescriptionFetchContext(SearchContext searchContext)
Create a FetchContext based on a SearchContext -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsBrokenAnalysis(String field)
Does the index analyzer for this field have token filters that may produce backwards offsets in term vectorsConfiguration for fetching docValues fieldsboolean
explain()
Should the response include `explain` outputConfiguration for the 'fields' responseboolean
Should the response include scores, even if scores were not calculated in the original queryConfiguration for fetching _sourceThe name of the index that documents are being fetched fromgetRootSourceLookup(FetchSubPhase.HitContext hitContext)
For a hit document that's being processed, return the source lookup representing the root document.getSearchExt(String name)
Configuration for external fetch phase pluginsConfiguration for highlightingConfiguration for returning inner hitsAny post-filters run as part of the searchThe original query with additional filters and named queriesorg.apache.lucene.search.Query
query()
The original queryrescore()
The rescorers included in the original search, used for explain outputConfiguration for script fieldssearcher()
The point-in-time searcher the original query was executed againstTheSearchLookup
for the this contextboolean
Should the response include sequence number and primary term metadataboolean
version()
Should the response include version metadata
-
Constructor Details
-
FetchContext
Create a FetchContext based on a SearchContext
-
-
Method Details
-
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
TheSearchLookup
for 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
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 -
getSearchExecutionContext
-
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.
-