Module org.elasticsearch.server
Package org.elasticsearch.search.runtime
Class AbstractScriptFieldQuery<S extends AbstractFieldScript>
java.lang.Object
org.apache.lucene.search.Query
org.elasticsearch.search.runtime.AbstractScriptFieldQuery<S>
- Direct Known Subclasses:
AbstractStringScriptFieldAutomatonQuery,BooleanScriptFieldExistsQuery,BooleanScriptFieldTermQuery,DoubleScriptFieldExistsQuery,DoubleScriptFieldRangeQuery,DoubleScriptFieldTermQuery,DoubleScriptFieldTermsQuery,GeoPointScriptFieldDistanceFeatureQuery,GeoPointScriptFieldExistsQuery,GeoPointScriptFieldGeoShapeQuery,IpScriptFieldExistsQuery,IpScriptFieldRangeQuery,IpScriptFieldTermQuery,IpScriptFieldTermsQuery,LongScriptFieldDistanceFeatureQuery,LongScriptFieldExistsQuery,LongScriptFieldRangeQuery,LongScriptFieldTermQuery,LongScriptFieldTermsQuery,StringScriptFieldExistsQuery,StringScriptFieldPrefixQuery,StringScriptFieldRangeQuery,StringScriptFieldTermQuery,StringScriptFieldTermsQuery
public abstract class AbstractScriptFieldQuery<S extends AbstractFieldScript>
extends org.apache.lucene.search.Query
Abstract base class for building queries based on script fields.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final floatWe don't have the infrastructure to estimate the match cost of a script so we just use a big number. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractScriptFieldQuery(Script script, String fieldName, Function<org.apache.lucene.index.LeafReaderContext, S> scriptContextFunction) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.search.TwoPhaseIteratorcreateTwoPhaseIterator(S scriptContext, org.apache.lucene.search.DocIdSetIterator approximation) Creates theTwoPhaseIteratorfor the current leaf reader.org.apache.lucene.search.WeightcreateWeight(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost) booleanfinal StringinthashCode()protected abstract booleanfinal Scriptscript()voidvisit(org.apache.lucene.search.QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString, toString
-
Field Details
-
MATCH_COST
protected static final float MATCH_COSTWe don't have the infrastructure to estimate the match cost of a script so we just use a big number.- See Also:
-
-
Constructor Details
-
AbstractScriptFieldQuery
-
-
Method Details
-
script
-
fieldName
-
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:
createWeightin classorg.apache.lucene.search.Query- Throws:
IOException
-
createTwoPhaseIterator
protected org.apache.lucene.search.TwoPhaseIterator createTwoPhaseIterator(S scriptContext, org.apache.lucene.search.DocIdSetIterator approximation) Creates theTwoPhaseIteratorfor the current leaf reader. Override to inject custom behaviour or provide additional context to the matches method when needed. -
matches
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.lucene.search.Query
-
equals
- Specified by:
equalsin classorg.apache.lucene.search.Query
-
visit
public void visit(org.apache.lucene.search.QueryVisitor visitor) - Specified by:
visitin classorg.apache.lucene.search.Query
-