Package org.opensearch.index.query
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
ConstructorDescriptionSourceFieldMatchQuery
(org.apache.lucene.search.Query delegateQuery, org.apache.lucene.search.Query filter, MappedFieldType fieldType, QueryShardContext context) Constructs a SourceFieldMatchQuery. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.Weight
createWeight
(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost) boolean
int
hashCode()
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
-
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 classorg.apache.lucene.search.Query
-
rewrite
public org.apache.lucene.search.Query rewrite(org.apache.lucene.search.IndexSearcher indexSearcher) throws IOException - Overrides:
rewrite
in classorg.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 classorg.apache.lucene.search.Query
- Throws:
IOException
-
equals
- Specified by:
equals
in classorg.apache.lucene.search.Query
-
hashCode
public int hashCode()- Specified by:
hashCode
in classorg.apache.lucene.search.Query
-
toString
- Specified by:
toString
in classorg.apache.lucene.search.Query
-