Module org.elasticsearch.compute
Package org.elasticsearch.compute.lucene
Class LuceneQueryScoreEvaluator
java.lang.Object
org.elasticsearch.compute.lucene.LuceneQueryEvaluator<DoubleVector.Builder>
org.elasticsearch.compute.lucene.LuceneQueryScoreEvaluator
- All Implemented Interfaces:
Closeable,AutoCloseable,ScoreOperator.ExpressionScorer,org.elasticsearch.core.Releasable
public class LuceneQueryScoreEvaluator
extends LuceneQueryEvaluator<DoubleVector.Builder>
implements ScoreOperator.ExpressionScorer
ScoreOperator.ExpressionScorer to run a Lucene Query during
the compute engine's normal execution, yielding the corresponding scores into
a DoubleVector.
Elements that don't match will have a score of NO_MATCH_SCORE.- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.compute.lucene.LuceneQueryEvaluator
LuceneQueryEvaluator.ShardConfig -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendMatch(DoubleVector.Builder builder, org.apache.lucene.search.Scorable scorer) Appends a matching result to a builder created by @link createVectorBuilder}protected voidappendNoMatch(DoubleVector.Builder builder) Appends a non matching result to a builder created by @link createVectorBuilder}protected VectorcreateNoMatchVector(BlockFactory blockFactory, int size) Creates a vector where all positions correspond to elements that don't match the queryprotected DoubleVector.BuildercreateVectorBuilder(BlockFactory blockFactory, int size) Creates the corresponding vector builder to store the results of evaluating the queryScores the expression.protected org.apache.lucene.search.ScoreModeReturns the score mode to use on searchesMethods inherited from class org.elasticsearch.compute.lucene.LuceneQueryEvaluator
close, executeQueryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Field Details
-
NO_MATCH_SCORE
public static final double NO_MATCH_SCORE- See Also:
-
-
Method Details
-
score
Description copied from interface:ScoreOperator.ExpressionScorerScores the expression.- Specified by:
scorein interfaceScoreOperator.ExpressionScorer- Returns:
- the returned Block has its own reference and the caller is responsible for releasing it.
-
scoreMode
protected org.apache.lucene.search.ScoreMode scoreMode()Description copied from class:LuceneQueryEvaluatorReturns the score mode to use on searches- Specified by:
scoreModein classLuceneQueryEvaluator<DoubleVector.Builder>
-
createNoMatchVector
Description copied from class:LuceneQueryEvaluatorCreates a vector where all positions correspond to elements that don't match the query- Specified by:
createNoMatchVectorin classLuceneQueryEvaluator<DoubleVector.Builder>
-
createVectorBuilder
Description copied from class:LuceneQueryEvaluatorCreates the corresponding vector builder to store the results of evaluating the query- Specified by:
createVectorBuilderin classLuceneQueryEvaluator<DoubleVector.Builder>
-
appendNoMatch
Description copied from class:LuceneQueryEvaluatorAppends a non matching result to a builder created by @link createVectorBuilder}- Specified by:
appendNoMatchin classLuceneQueryEvaluator<DoubleVector.Builder>
-
appendMatch
protected void appendMatch(DoubleVector.Builder builder, org.apache.lucene.search.Scorable scorer) throws IOException Description copied from class:LuceneQueryEvaluatorAppends a matching result to a builder created by @link createVectorBuilder}- Specified by:
appendMatchin classLuceneQueryEvaluator<DoubleVector.Builder>- Throws:
IOException
-