org.elasticsearch.search.internal
Class SearchContext

java.lang.Object
  extended by org.elasticsearch.search.internal.SearchContext
All Implemented Interfaces:
Releasable

public class SearchContext
extends java.lang.Object
implements Releasable


Constructor Summary
SearchContext(long id, SearchShardTarget shardTarget, int numberOfShards, TimeValue timeout, java.lang.String[] types, Engine.Searcher engineSearcher, IndexService indexService, ScriptService scriptService)
           
 
Method Summary
 void accessed(long accessTime)
           
static SearchContext current()
           
 DfsSearchResult dfsResult()
           
 int[] docIdsToLoad()
           
 SearchContext docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadFrom, int docsIdsToLoadSize)
           
 int docIdsToLoadFrom()
           
 int docIdsToLoadSize()
           
 void emptyFieldNames()
           
 boolean explain()
           
 void explain(boolean explain)
           
 SearchContextFacets facets()
           
 SearchContext facets(SearchContextFacets facets)
           
 FetchSearchResult fetchResult()
           
 FieldDataCache fieldDataCache()
           
 java.util.List<java.lang.String> fieldNames()
           
 FilterCache filterCache()
           
 int from()
           
 SearchContext from(int from)
           
 boolean hasFieldNames()
           
 boolean hasScriptFields()
           
 SearchContextHighlight highlight()
           
 void highlight(SearchContextHighlight highlight)
           
 long id()
           
 long keepAlive()
           
 void keepAlive(long keepAlive)
           
 long lastAccessTime()
           
 MapperService mapperService()
           
 int numberOfShards()
           
 ParsedQuery parsedQuery()
           
 SearchContext parsedQuery(ParsedQuery query)
           
 org.apache.lucene.search.Query query()
          The query to execute, might be rewritten.
 float queryBoost()
           
 SearchContext queryBoost(float queryBoost)
           
 IndexQueryParser queryParser()
           
 java.lang.String queryParserName()
           
 SearchContext queryParserName(java.lang.String queryParserName)
           
 IndexQueryParserService queryParserService()
           
 QuerySearchResult queryResult()
           
 boolean queryRewritten()
          Has the query been rewritten already?
 boolean release()
           
static void removeCurrent()
           
 ScriptFieldsContext scriptFields()
           
 ScriptSearchLookup scriptSearchLookup()
           
 ScriptService scriptService()
           
 Scroll scroll()
           
 SearchContext scroll(Scroll scroll)
           
 ContextIndexSearcher searcher()
           
static void setCurrent(SearchContext value)
           
 SearchShardTarget shardTarget()
           
 SimilarityService similarityService()
           
 int size()
           
 SearchContext size(int size)
           
 org.apache.lucene.search.Sort sort()
           
 SearchContext sort(org.apache.lucene.search.Sort sort)
           
 TimeValue timeout()
           
 java.lang.String[] types()
           
 SearchContext updateRewriteQuery(org.apache.lucene.search.Query rewriteQuery)
          Rewrites the query and updates it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchContext

public SearchContext(long id,
                     SearchShardTarget shardTarget,
                     int numberOfShards,
                     TimeValue timeout,
                     java.lang.String[] types,
                     Engine.Searcher engineSearcher,
                     IndexService indexService,
                     ScriptService scriptService)
Method Detail

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()

queryParserService

public IndexQueryParserService queryParserService()

similarityService

public SimilarityService similarityService()

scriptService

public ScriptService scriptService()

filterCache

public FilterCache filterCache()

fieldDataCache

public FieldDataCache fieldDataCache()

timeout

public TimeValue timeout()

sort

public SearchContext sort(org.apache.lucene.search.Sort sort)

sort

public org.apache.lucene.search.Sort sort()

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)

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)

scriptSearchLookup

public ScriptSearchLookup scriptSearchLookup()

dfsResult

public DfsSearchResult dfsResult()

queryResult

public QuerySearchResult queryResult()

fetchResult

public FetchSearchResult fetchResult()