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 float
We don't have the infrastructure to estimate the match cost of a script so we just use a big number. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractScriptFieldQuery
(Script script, String fieldName, Function<org.apache.lucene.index.LeafReaderContext, S> scriptContextFunction) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.lucene.search.TwoPhaseIterator
createTwoPhaseIterator
(S scriptContext, org.apache.lucene.search.DocIdSetIterator approximation) Creates theTwoPhaseIterator
for the current leaf reader.org.apache.lucene.search.Weight
createWeight
(org.apache.lucene.search.IndexSearcher searcher, org.apache.lucene.search.ScoreMode scoreMode, float boost) boolean
final String
int
hashCode()
protected abstract boolean
final Script
script()
void
visit
(org.apache.lucene.search.QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, 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:
createWeight
in classorg.apache.lucene.search.Query
- Throws:
IOException
-
createTwoPhaseIterator
protected org.apache.lucene.search.TwoPhaseIterator createTwoPhaseIterator(S scriptContext, org.apache.lucene.search.DocIdSetIterator approximation) Creates theTwoPhaseIterator
for 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:
hashCode
in classorg.apache.lucene.search.Query
-
equals
- Specified by:
equals
in classorg.apache.lucene.search.Query
-
visit
public void visit(org.apache.lucene.search.QueryVisitor visitor) - Specified by:
visit
in classorg.apache.lucene.search.Query
-