Class DefaultSearchContext

    • Method Detail

      • preProcess

        public void preProcess()
        Should be called before executing the main query and after all other parameters have been set.
      • searchFilter

        public org.apache.lucene.search.Filter searchFilter(String[] types)
      • id

        public long id()
      • source

        public String source()
      • numberOfShards

        public int numberOfShards()
      • hasTypes

        public boolean hasTypes()
      • types

        public String[] types()
      • queryBoost

        public float queryBoost()
      • nowInMillisImpl

        protected long nowInMillisImpl()
      • scroll

        public Scroll scroll()
      • hasFieldDataFields

        public boolean hasFieldDataFields()
      • hasScriptFields

        public boolean hasScriptFields()
      • hasPartialFields

        public boolean hasPartialFields()
      • sourceRequested

        public boolean sourceRequested()
        A shortcut function to see whether there is a fetchSourceContext and it says the source is requested.
        Specified by:
        sourceRequested in class  SearchContext
        Returns:
      • hasFetchSourceContext

        public boolean hasFetchSourceContext()
      • timeoutInMillis

        public long timeoutInMillis()
      • timeoutInMillis

        public void timeoutInMillis(long timeoutInMillis)
      • terminateAfter

        public int terminateAfter()
      • terminateAfter

        public void terminateAfter(int terminateAfter)
      • 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()
      • aliasFilter

        public org.apache.lucene.search.Filter aliasFilter()
      • 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()
      • size

        public int size()
      • hasFieldNames

        public boolean hasFieldNames()
      • emptyFieldNames

        public void emptyFieldNames()
      • explain

        public boolean explain()
      • explain

        public void explain(boolean explain)
      • 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)
      • lastEmittedDoc

        public void lastEmittedDoc(org.apache.lucene.search.ScoreDoc doc)
      • lastEmittedDoc

        public org.apache.lucene.search.ScoreDoc lastEmittedDoc()
      • smartNameFieldMapperFromAnyType

        public FieldMapper smartNameFieldMapperFromAnyType(String name)
        Description copied from class: SearchContext
        Looks up the given field, but does not restrict to fields in the types set on this context.
      • useSlowScroll

        public boolean useSlowScroll()
      • timeEstimateCounter

        public org.apache.lucene.util.Counter timeEstimateCounter()
      • putInContext

        public <V> V putInContext(Object key,
                                  Object value)
        Description copied from interface: HasContext
        Attaches the given value to the context.
        Returns:
        The previous value that was associated with the given key in the context, or null if there was none.
      • putAllInContext

        public void putAllInContext(<any> map)
        Description copied from interface: HasContext
        Attaches the given values to the context
      • getFromContext

        public <V> V getFromContext(Object key,
                                    V defaultValue)
        defaultValue - The default value that should be returned for the given key, if no value is currently associated with it.
        Returns:
        The value that is associated with the given key in the context
        See Also:
        HasContext.putInContext(Object, Object)
      • hasInContext

        public boolean hasInContext(Object key)
        Description copied from interface: HasContext
        Checks if the context contains an entry with the given key
      • contextSize

        public int contextSize()
        Returns:
        The number of values attached in the context.
      • isContextEmpty

        public boolean isContextEmpty()
        Description copied from interface: HasContext
        Checks if the context is empty.
      • copyContextFrom

        public void copyContextFrom(HasContext other)
        Description copied from interface: HasContext
        Copies the context from the given context holder to this context holder. Any shared keys between the two context will be overridden by the given context holder.
      • getHeader

        public <V> V getHeader(String key)
      • hasHeader

        public boolean hasHeader(String key)
      • getHeaders

        public Set<String> getHeaders()
      • copyHeadersFrom

        public void copyHeadersFrom(HasHeaders from)
      • copyContextAndHeadersFrom

        public void copyContextAndHeadersFrom(HasContextAndHeaders other)
        Description copied from interface: HasContextAndHeaders
        copies over the context and the headers
        Parameters:
        other - another object supporting headers and context