org.elasticsearch.search.internal
Class SearchContext
java.lang.Object
org.elasticsearch.search.internal.SearchContext
- All Implemented Interfaces:
- Releasable
public class SearchContext
- extends java.lang.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,
SearchShardTarget shardTarget,
int numberOfShards,
TimeValue timeout,
java.lang.String[] types,
Engine.Searcher engineSearcher,
IndexService indexService,
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
id
public long id()
shardTarget
public SearchShardTarget shardTarget()
numberOfShards
public int numberOfShards()
types
public java.lang.String[] types()
queryBoost
public float queryBoost()
queryBoost
public SearchContext queryBoost(float queryBoost)
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()
searcher
public ContextIndexSearcher searcher()
queryParser
public IndexQueryParser queryParser()
throws IndexQueryParserMissingException
- Throws:
IndexQueryParserMissingException
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()
timeout
public TimeValue timeout()
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()
queryParserName
public java.lang.String queryParserName()
queryParserName
public SearchContext queryParserName(java.lang.String queryParserName)
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 java.util.List<java.lang.String> fieldNames()
emptyFieldNames
public void emptyFieldNames()
explain
public boolean explain()
explain
public void explain(boolean explain)
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()