Module org.elasticsearch.compute
Package org.elasticsearch.compute.lucene
Class LuceneQueryScoreEvaluator
java.lang.Object
org.elasticsearch.compute.lucene.LuceneQueryEvaluator<DoubleBlock.Builder>
org.elasticsearch.compute.lucene.LuceneQueryScoreEvaluator
- All Implemented Interfaces:
Closeable,AutoCloseable,ScoreOperator.ExpressionScorer,org.elasticsearch.core.Releasable
public class LuceneQueryScoreEvaluator
extends LuceneQueryEvaluator<DoubleBlock.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
FieldsFields inherited from class org.elasticsearch.compute.lucene.LuceneQueryEvaluator
shards -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendMatch(DoubleBlock.Builder builder, org.apache.lucene.search.Scorable scorer) Appends a matching result to a builder created by @link createVectorBuilder}protected voidappendNoMatch(DoubleBlock.Builder builder) Appends a non matching result to a builder created by @link createVectorBuilder}protected DoubleBlock.BuildercreateBlockBuilder(BlockFactory blockFactory, int size) Creates the corresponding vector builder to store the results of evaluating the queryprotected DoubleBlockcreateNoMatchBlock(BlockFactory blockFactory, int size) Creates a vector where all positions correspond to elements that don't match 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<DoubleBlock.Builder>
-
createNoMatchBlock
Description copied from class:LuceneQueryEvaluatorCreates a vector where all positions correspond to elements that don't match the query- Specified by:
createNoMatchBlockin classLuceneQueryEvaluator<DoubleBlock.Builder>
-
createBlockBuilder
Description copied from class:LuceneQueryEvaluatorCreates the corresponding vector builder to store the results of evaluating the query- Specified by:
createBlockBuilderin classLuceneQueryEvaluator<DoubleBlock.Builder>
-
appendNoMatch
Description copied from class:LuceneQueryEvaluatorAppends a non matching result to a builder created by @link createVectorBuilder}- Specified by:
appendNoMatchin classLuceneQueryEvaluator<DoubleBlock.Builder>
-
appendMatch
protected void appendMatch(DoubleBlock.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<DoubleBlock.Builder>- Throws:
IOException
-