org.elasticsearch.search.internal
Class SearchContext
java.lang.Object
org.elasticsearch.search.internal.SearchContext
- All Implemented Interfaces:
- Releasable
public class SearchContext
- extends Object
- implements Releasable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SearchContext
public SearchContext(long id,
InternalSearchRequest request,
SearchShardTarget shardTarget,
Engine.Searcher engineSearcher,
IndexService indexService,
IndexShard indexShard,
ScriptService scriptService)
setCurrent
public static void setCurrent(SearchContext value)
removeCurrent
public static void removeCurrent()
current
public static SearchContext current()
release
public boolean release()
throws ElasticSearchException
- Specified by:
release
in interface Releasable
- Throws:
ElasticSearchException
preProcess
public void preProcess()
- Should be called before executing the main query and after all other parameters have been set.
id
public long id()
request
public InternalSearchRequest request()
searchType
public SearchType searchType()
searchType
public SearchContext searchType(SearchType searchType)
shardTarget
public SearchShardTarget shardTarget()
numberOfShards
public int numberOfShards()
hasTypes
public boolean hasTypes()
types
public String[] types()
queryBoost
public float queryBoost()
queryBoost
public SearchContext queryBoost(float queryBoost)
nowInMillis
public long nowInMillis()
scroll
public Scroll scroll()
scroll
public SearchContext scroll(Scroll scroll)
facets
public SearchContextFacets facets()
facets
public SearchContext facets(SearchContextFacets facets)
highlight
public SearchContextHighlight highlight()
highlight
public void highlight(SearchContextHighlight highlight)
hasScriptFields
public boolean hasScriptFields()
scriptFields
public ScriptFieldsContext scriptFields()
hasPartialFields
public boolean hasPartialFields()
partialFields
public PartialFieldsContext partialFields()
searcher
public ContextIndexSearcher searcher()
indexShard
public IndexShard indexShard()
mapperService
public MapperService mapperService()
analysisService
public AnalysisService analysisService()
queryParserService
public IndexQueryParserService queryParserService()
similarityService
public SimilarityService similarityService()
scriptService
public ScriptService scriptService()
filterCache
public FilterCache filterCache()
fieldDataCache
public FieldDataCache fieldDataCache()
idCache
public IdCache idCache()
timeoutInMillis
public long timeoutInMillis()
timeoutInMillis
public void timeoutInMillis(long timeoutInMillis)
minimumScore
public SearchContext minimumScore(float minimumScore)
minimumScore
public Float minimumScore()
sort
public SearchContext sort(org.apache.lucene.search.Sort sort)
sort
public org.apache.lucene.search.Sort sort()
trackScores
public SearchContext trackScores(boolean trackScores)
trackScores
public boolean trackScores()
parsedFilter
public SearchContext parsedFilter(org.apache.lucene.search.Filter filter)
parsedFilter
public org.apache.lucene.search.Filter parsedFilter()
aliasFilter
public org.apache.lucene.search.Filter aliasFilter()
parsedQuery
public SearchContext parsedQuery(ParsedQuery query)
parsedQuery
public ParsedQuery parsedQuery()
query
public org.apache.lucene.search.Query query()
- The query to execute, might be rewritten.
queryRewritten
public boolean queryRewritten()
- Has the query been rewritten already?
updateRewriteQuery
public SearchContext updateRewriteQuery(org.apache.lucene.search.Query rewriteQuery)
- Rewrites the query and updates it. Only happens once.
from
public int from()
from
public SearchContext from(int from)
size
public int size()
size
public SearchContext size(int size)
hasFieldNames
public boolean hasFieldNames()
fieldNames
public List<String> fieldNames()
emptyFieldNames
public void emptyFieldNames()
explain
public boolean explain()
explain
public void explain(boolean explain)
groupStats
@Nullable
public List<String> groupStats()
groupStats
public void groupStats(List<String> groupStats)
version
public boolean version()
version
public void version(boolean version)
docIdsToLoad
public int[] docIdsToLoad()
docIdsToLoadFrom
public int docIdsToLoadFrom()
docIdsToLoadSize
public int docIdsToLoadSize()
docIdsToLoad
public SearchContext docIdsToLoad(int[] docIdsToLoad,
int docsIdsToLoadFrom,
int docsIdsToLoadSize)
accessed
public void accessed(long accessTime)
lastAccessTime
public long lastAccessTime()
keepAlive
public long keepAlive()
keepAlive
public void keepAlive(long keepAlive)
lookup
public SearchLookup lookup()
dfsResult
public DfsSearchResult dfsResult()
queryResult
public QuerySearchResult queryResult()
fetchResult
public FetchSearchResult fetchResult()
scopePhases
public List<ScopePhase> scopePhases()
addScopePhase
public void addScopePhase(ScopePhase scopePhase)
nestedQueries
public Map<String,BlockJoinQuery> nestedQueries()
addNestedQuery
public void addNestedQuery(String scope,
BlockJoinQuery query)
scanContext
public ScanContext scanContext()
smartFieldMappers
public MapperService.SmartNameFieldMappers smartFieldMappers(String name)
smartNameFieldMappers
public FieldMappers smartNameFieldMappers(String name)
smartNameFieldMapper
public FieldMapper smartNameFieldMapper(String name)
smartNameObjectMapper
public MapperService.SmartNameObjectMapper smartNameObjectMapper(String name)
Copyright © 2009-2012. All Rights Reserved.