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 FetchDocValuesContextdocValuesContext()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 fromIndexSettingsgetIndexSettings()The index settings for the index we are fetching documents fromSearchExtBuildergetSearchExt(java.lang.String name)Configuration for external fetch phase pluginsSearchHighlightContexthighlight()Configuration for highlightingInnerHitsContextinnerHits()Configuration for returning inner hitsMapperServicemapperService()The mapper service for the index we are fetching documents fromParsedQueryparsedPostFilter()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 -
mapperService
The mapper service for the index we are fetching documents from -
getIndexSettings
The index settings for the index we are fetching documents from -
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 -
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
-