Class SourceFieldMatchQuery

java.lang.Object
org.apache.lucene.search.Query
org.opensearch.index.query.SourceFieldMatchQuery

public class SourceFieldMatchQuery extends org.apache.lucene.search.Query
A query that matches against each document from the parent query by filtering using the source field values. Useful to query against field type which doesn't store positional data and field is not stored/computed dynamically.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SourceFieldMatchQuery(org.apache.lucene.search.Query delegateQuery, org.apache.lucene.search.Query filter, MappedFieldType fieldType, QueryShardContext context)
    Constructs a SourceFieldMatchQuery.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.search.Weight
    createWeight(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost)
     
    boolean
     
    int
     
    org.apache.lucene.search.Query
    rewrite(org.apache.lucene.search.IndexSearcher indexSearcher)
     
     
    void
    visit(org.apache.lucene.search.QueryVisitor visitor)
     

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

    classHash, rewrite, sameClassAs, toString

    Methods inherited from class java.lang.Object

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

    • SourceFieldMatchQuery

      public SourceFieldMatchQuery(org.apache.lucene.search.Query delegateQuery, org.apache.lucene.search.Query filter, MappedFieldType fieldType, QueryShardContext context)
      Constructs a SourceFieldMatchQuery.
      Parameters:
      delegateQuery - The parent query to use to find matches.
      filter - The query used to filter further by running against field value fetched using _source field.
      fieldType - The mapped field type.
      context - The QueryShardContext to get lookup and valueFetcher
  • Method Details

    • visit

      public void visit(org.apache.lucene.search.QueryVisitor visitor)
      Specified by:
      visit in class org.apache.lucene.search.Query
    • rewrite

      public org.apache.lucene.search.Query rewrite(org.apache.lucene.search.IndexSearcher indexSearcher) 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
    • equals

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

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

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