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, SearchType searchType, int numberOfShards, TimeValue timeout, java.lang.String[] types, Engine.Searcher engineSearcher, IndexService indexService, ScriptService scriptService)
           
 
Method Summary
 void accessed(long accessTime)
           
 void addScopePhase(ScopePhase scopePhase)
           
 AnalysisService analysisService()
           
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()
           
 IdCache idCache()
           
 long keepAlive()
           
 void keepAlive(long keepAlive)
           
 long lastAccessTime()
           
 SearchLookup lookup()
           
 MapperService mapperService()
           
 java.lang.Float minimumScore()
           
 SearchContext minimumScore(float minimumScore)
           
 int numberOfShards()
           
 org.apache.lucene.search.Filter parsedFilter()
           
 SearchContext parsedFilter(org.apache.lucene.search.Filter filter)
           
 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()
           
 java.util.List<ScopePhase> scopePhases()
           
 ScriptFieldsContext scriptFields()
           
 ScriptService scriptService()
           
 Scroll scroll()
           
 SearchContext scroll(Scroll scroll)
           
 ContextIndexSearcher searcher()
           
 SearchType searchType()
           
 SearchContext searchType(SearchType searchType)
           
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()
           
 boolean trackScores()
           
 SearchContext trackScores(boolean trackScores)
           
 java.lang.String[] types()
           
 SearchContext updateRewriteQuery(org.apache.lucene.search.Query rewriteQuery)
          Rewrites the query and updates it.
 boolean version()
           
 void version(boolean version)
           
 
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,
                     SearchType searchType,
                     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()

searchType

public SearchType searchType()

searchType

public SearchContext searchType(SearchType searchType)

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

minimumScore

public SearchContext minimumScore(float minimumScore)

minimumScore

public java.lang.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()

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

scopePhases

public java.util.List<ScopePhase> scopePhases()

addScopePhase

public void addScopePhase(ScopePhase scopePhase)