Class SourceConfirmedTextQuery

java.lang.Object
org.apache.lucene.search.Query
org.elasticsearch.index.query.SourceConfirmedTextQuery

public final class SourceConfirmedTextQuery extends org.apache.lucene.search.Query
A variant of TermQuery, PhraseQuery, MultiPhraseQuery and span queries that uses postings for its approximation, but falls back to stored fields or _source whenever term frequencies or positions are needed. This query matches and scores the same way as the wrapped query.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SourceConfirmedTextQuery​(org.apache.lucene.search.Query in, Function<org.apache.lucene.index.LeafReaderContext,​org.elasticsearch.common.CheckedIntFunction<List<Object>,​IOException>> valueFetcherProvider, org.apache.lucene.analysis.Analyzer indexAnalyzer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.lucene.search.Query
    approximate​(org.apache.lucene.search.Query query)
    Create an approximation for the given query.
    org.apache.lucene.search.Weight
    createWeight​(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost)
     
    boolean
    equals​(Object obj)
     
    org.apache.lucene.search.Query
     
    int
     
    org.apache.lucene.search.Query
    rewrite​(org.apache.lucene.index.IndexReader reader)
     
    toString​(String field)
     

    Methods inherited from class org.apache.lucene.search.Query

    classHash, sameClassAs, toString, visit

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SourceConfirmedTextQuery

      public SourceConfirmedTextQuery(org.apache.lucene.search.Query in, Function<org.apache.lucene.index.LeafReaderContext,​org.elasticsearch.common.CheckedIntFunction<List<Object>,​IOException>> valueFetcherProvider, org.apache.lucene.analysis.Analyzer indexAnalyzer)
  • Method Details

    • approximate

      public static org.apache.lucene.search.Query approximate(org.apache.lucene.search.Query query)
      Create an approximation for the given query. The returned approximation should match a superset of the matches of the provided query.
    • getQuery

      public org.apache.lucene.search.Query getQuery()
    • toString

      public String toString(String field)
      Specified by:
      toString in class org.apache.lucene.search.Query
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in class org.apache.lucene.search.Query
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class org.apache.lucene.search.Query
    • rewrite

      public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader) throws IOException
      Overrides:
      rewrite in class org.apache.lucene.search.Query
      Throws:
      IOException
    • createWeight

      public org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost) throws IOException
      Overrides:
      createWeight in class org.apache.lucene.search.Query
      Throws:
      IOException