public class DefaultSearchContext extends SearchContext
SearchContext.Lifetime
DEFAULT_TERMINATE_AFTER, parseFieldMatcher
Constructor and Description |
---|
DefaultSearchContext(long id,
ShardSearchRequest request,
SearchShardTarget shardTarget,
Engine.Searcher engineSearcher,
IndexService indexService,
IndexShard indexShard,
ScriptService scriptService,
PageCacheRecycler pageCacheRecycler,
BigArrays bigArrays,
org.apache.lucene.util.Counter timeEstimateCounter,
ParseFieldMatcher parseFieldMatcher,
TimeValue timeout,
FetchPhase fetchPhase) |
Modifier and Type | Method and Description |
---|---|
void |
accessed(long accessTime) |
void |
addRescore(RescoreSearchContext rescore) |
SearchContextAggregations |
aggregations() |
SearchContext |
aggregations(SearchContextAggregations aggregations) |
org.apache.lucene.search.Query |
aliasFilter() |
AnalysisService |
analysisService() |
BigArrays |
bigArrays() |
BitsetFilterCache |
bitsetFilterCache() |
DfsSearchResult |
dfsResult() |
int[] |
docIdsToLoad() |
SearchContext |
docIdsToLoad(int[] docIdsToLoad,
int docsIdsToLoadFrom,
int docsIdsToLoadSize) |
int |
docIdsToLoadFrom() |
int |
docIdsToLoadSize() |
void |
doClose() |
void |
emptyFieldNames() |
boolean |
explain() |
void |
explain(boolean explain) |
FetchPhase |
fetchPhase() |
FetchSearchResult |
fetchResult() |
FetchSourceContext |
fetchSourceContext() |
SearchContext |
fetchSourceContext(FetchSourceContext fetchSourceContext) |
IndexFieldDataService |
fieldData() |
java.util.List<java.lang.String> |
fieldNames() |
ParsedQuery |
filteredQuery() |
int |
from() |
SearchContext |
from(int from) |
<SubPhaseContext extends FetchSubPhaseContext> |
getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory) |
ObjectMapper |
getObjectMapper(java.lang.String name) |
long |
getOriginNanoTime() |
Profilers |
getProfilers()
Return a handle over the profilers for the current search request, or
null if profiling is not enabled. |
QueryShardContext |
getQueryShardContext() |
java.util.List<java.lang.String> |
groupStats() |
void |
groupStats(java.util.List<java.lang.String> groupStats) |
boolean |
hasFetchSourceContext() |
boolean |
hasFieldNames() |
boolean |
hasScriptFields() |
SearchContextHighlight |
highlight() |
void |
highlight(SearchContextHighlight highlight) |
long |
id() |
IndexShard |
indexShard() |
long |
keepAlive() |
void |
keepAlive(long keepAlive) |
long |
lastAccessTime() |
SearchLookup |
lookup() |
MapperService |
mapperService() |
java.lang.Float |
minimumScore() |
SearchContext |
minimumScore(float minimumScore) |
protected long |
nowInMillisImpl() |
int |
numberOfShards() |
PageCacheRecycler |
pageCacheRecycler() |
ParsedQuery |
parsedPostFilter() |
SearchContext |
parsedPostFilter(ParsedQuery postFilter) |
ParsedQuery |
parsedQuery() |
SearchContext |
parsedQuery(ParsedQuery query) |
PercolatorQueryCache |
percolatorQueryCache() |
void |
preProcess()
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, in its rewritten form.
|
float |
queryBoost() |
SearchContext |
queryBoost(float queryBoost) |
java.util.Map<java.lang.Class<?>,org.apache.lucene.search.Collector> |
queryCollectors()
Return a view of the additional query collectors that should be run for this context.
|
QuerySearchResult |
queryResult() |
ShardSearchRequest |
request() |
java.util.List<RescoreSearchContext> |
rescore() |
ScriptFieldsContext |
scriptFields() |
ScriptService |
scriptService() |
ScrollContext |
scrollContext() |
SearchContext |
scrollContext(ScrollContext scrollContext) |
org.apache.lucene.search.FieldDoc |
searchAfter() |
SearchContext |
searchAfter(org.apache.lucene.search.FieldDoc searchAfter) |
ContextIndexSearcher |
searcher() |
org.apache.lucene.search.Query |
searchFilter(java.lang.String[] types) |
SearchType |
searchType() |
SearchContext |
searchType(SearchType searchType) |
void |
setProfilers(Profilers profilers) |
SearchShardTarget |
shardTarget() |
SimilarityService |
similarityService() |
int |
size() |
SearchContext |
size(int size) |
MappedFieldType |
smartNameFieldType(java.lang.String name)
Looks up the given field, but does not restrict to fields in the types set on this context.
|
org.apache.lucene.search.Sort |
sort() |
SearchContext |
sort(org.apache.lucene.search.Sort sort) |
java.lang.String |
source() |
boolean |
sourceRequested()
A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.
|
SuggestionSearchContext |
suggest() |
void |
suggest(SuggestionSearchContext suggest) |
int |
terminateAfter() |
void |
terminateAfter(int terminateAfter) |
org.apache.lucene.util.Counter |
timeEstimateCounter() |
long |
timeoutInMillis() |
void |
timeoutInMillis(long timeoutInMillis) |
boolean |
trackScores() |
SearchContext |
trackScores(boolean trackScores) |
boolean |
version() |
void |
version(boolean version) |
addReleasable, clearReleasables, close, current, hasOnlySuggest, innerHits, nowInMillis, nowInMillisUsed, parseFieldMatcher, removeCurrent, resetNowInMillisUsed, setCurrent
public DefaultSearchContext(long id, ShardSearchRequest request, SearchShardTarget shardTarget, Engine.Searcher engineSearcher, IndexService indexService, IndexShard indexShard, ScriptService scriptService, PageCacheRecycler pageCacheRecycler, BigArrays bigArrays, org.apache.lucene.util.Counter timeEstimateCounter, ParseFieldMatcher parseFieldMatcher, TimeValue timeout, FetchPhase fetchPhase)
public void doClose()
doClose
in class SearchContext
public void preProcess()
preProcess
in class SearchContext
@Nullable public org.apache.lucene.search.Query searchFilter(java.lang.String[] types)
searchFilter
in class SearchContext
public long id()
id
in class SearchContext
public java.lang.String source()
source
in class SearchContext
public ShardSearchRequest request()
request
in class SearchContext
public SearchType searchType()
searchType
in class SearchContext
public SearchContext searchType(SearchType searchType)
searchType
in class SearchContext
public SearchShardTarget shardTarget()
shardTarget
in class SearchContext
public int numberOfShards()
numberOfShards
in class SearchContext
public float queryBoost()
queryBoost
in class SearchContext
public SearchContext queryBoost(float queryBoost)
queryBoost
in class SearchContext
public long getOriginNanoTime()
getOriginNanoTime
in class SearchContext
protected long nowInMillisImpl()
nowInMillisImpl
in class SearchContext
public ScrollContext scrollContext()
scrollContext
in class SearchContext
public SearchContext scrollContext(ScrollContext scrollContext)
scrollContext
in class SearchContext
public SearchContextAggregations aggregations()
aggregations
in class SearchContext
public SearchContext aggregations(SearchContextAggregations aggregations)
aggregations
in class SearchContext
public <SubPhaseContext extends FetchSubPhaseContext> SubPhaseContext getFetchSubPhaseContext(FetchSubPhase.ContextFactory<SubPhaseContext> contextFactory)
getFetchSubPhaseContext
in class SearchContext
public SearchContextHighlight highlight()
highlight
in class SearchContext
public void highlight(SearchContextHighlight highlight)
highlight
in class SearchContext
public SuggestionSearchContext suggest()
suggest
in class SearchContext
public void suggest(SuggestionSearchContext suggest)
suggest
in class SearchContext
public java.util.List<RescoreSearchContext> rescore()
rescore
in class SearchContext
public void addRescore(RescoreSearchContext rescore)
addRescore
in class SearchContext
public boolean hasScriptFields()
hasScriptFields
in class SearchContext
public ScriptFieldsContext scriptFields()
scriptFields
in class SearchContext
public boolean sourceRequested()
sourceRequested
in class SearchContext
public boolean hasFetchSourceContext()
hasFetchSourceContext
in class SearchContext
public FetchSourceContext fetchSourceContext()
fetchSourceContext
in class SearchContext
public SearchContext fetchSourceContext(FetchSourceContext fetchSourceContext)
fetchSourceContext
in class SearchContext
public ContextIndexSearcher searcher()
searcher
in class SearchContext
public IndexShard indexShard()
indexShard
in class SearchContext
public MapperService mapperService()
mapperService
in class SearchContext
public AnalysisService analysisService()
analysisService
in class SearchContext
public SimilarityService similarityService()
similarityService
in class SearchContext
public ScriptService scriptService()
scriptService
in class SearchContext
public PageCacheRecycler pageCacheRecycler()
pageCacheRecycler
in class SearchContext
public BigArrays bigArrays()
bigArrays
in class SearchContext
public BitsetFilterCache bitsetFilterCache()
bitsetFilterCache
in class SearchContext
public IndexFieldDataService fieldData()
fieldData
in class SearchContext
public PercolatorQueryCache percolatorQueryCache()
percolatorQueryCache
in class SearchContext
public long timeoutInMillis()
timeoutInMillis
in class SearchContext
public void timeoutInMillis(long timeoutInMillis)
timeoutInMillis
in class SearchContext
public int terminateAfter()
terminateAfter
in class SearchContext
public void terminateAfter(int terminateAfter)
terminateAfter
in class SearchContext
public SearchContext minimumScore(float minimumScore)
minimumScore
in class SearchContext
public java.lang.Float minimumScore()
minimumScore
in class SearchContext
public SearchContext sort(org.apache.lucene.search.Sort sort)
sort
in class SearchContext
public org.apache.lucene.search.Sort sort()
sort
in class SearchContext
public SearchContext trackScores(boolean trackScores)
trackScores
in class SearchContext
public boolean trackScores()
trackScores
in class SearchContext
public SearchContext searchAfter(org.apache.lucene.search.FieldDoc searchAfter)
searchAfter
in class SearchContext
public org.apache.lucene.search.FieldDoc searchAfter()
searchAfter
in class SearchContext
public SearchContext parsedPostFilter(ParsedQuery postFilter)
parsedPostFilter
in class SearchContext
public ParsedQuery parsedPostFilter()
parsedPostFilter
in class SearchContext
public org.apache.lucene.search.Query aliasFilter()
aliasFilter
in class SearchContext
public SearchContext parsedQuery(ParsedQuery query)
parsedQuery
in class SearchContext
public ParsedQuery filteredQuery()
public ParsedQuery parsedQuery()
parsedQuery
in class SearchContext
public org.apache.lucene.search.Query query()
query
in class SearchContext
public int from()
from
in class SearchContext
public SearchContext from(int from)
from
in class SearchContext
public int size()
size
in class SearchContext
public SearchContext size(int size)
size
in class SearchContext
public boolean hasFieldNames()
hasFieldNames
in class SearchContext
public java.util.List<java.lang.String> fieldNames()
fieldNames
in class SearchContext
public void emptyFieldNames()
emptyFieldNames
in class SearchContext
public boolean explain()
explain
in class SearchContext
public void explain(boolean explain)
explain
in class SearchContext
@Nullable public java.util.List<java.lang.String> groupStats()
groupStats
in class SearchContext
public void groupStats(java.util.List<java.lang.String> groupStats)
groupStats
in class SearchContext
public boolean version()
version
in class SearchContext
public void version(boolean version)
version
in class SearchContext
public int[] docIdsToLoad()
docIdsToLoad
in class SearchContext
public int docIdsToLoadFrom()
docIdsToLoadFrom
in class SearchContext
public int docIdsToLoadSize()
docIdsToLoadSize
in class SearchContext
public SearchContext docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadFrom, int docsIdsToLoadSize)
docIdsToLoad
in class SearchContext
public void accessed(long accessTime)
accessed
in class SearchContext
public long lastAccessTime()
lastAccessTime
in class SearchContext
public long keepAlive()
keepAlive
in class SearchContext
public void keepAlive(long keepAlive)
keepAlive
in class SearchContext
public SearchLookup lookup()
lookup
in class SearchContext
public DfsSearchResult dfsResult()
dfsResult
in class SearchContext
public QuerySearchResult queryResult()
queryResult
in class SearchContext
public FetchPhase fetchPhase()
fetchPhase
in class SearchContext
public FetchSearchResult fetchResult()
fetchResult
in class SearchContext
public MappedFieldType smartNameFieldType(java.lang.String name)
SearchContext
smartNameFieldType
in class SearchContext
public ObjectMapper getObjectMapper(java.lang.String name)
getObjectMapper
in class SearchContext
public org.apache.lucene.util.Counter timeEstimateCounter()
timeEstimateCounter
in class SearchContext
public java.util.Map<java.lang.Class<?>,org.apache.lucene.search.Collector> queryCollectors()
SearchContext
queryCollectors
in class SearchContext
public QueryShardContext getQueryShardContext()
getQueryShardContext
in class SearchContext
public Profilers getProfilers()
SearchContext
null
if profiling is not enabled.getProfilers
in class SearchContext
public void setProfilers(Profilers profilers)