Module org.apache.lucene.core
Package org.apache.lucene.search
Class AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier
java.lang.Object
org.apache.lucene.search.ScorerSupplier
org.apache.lucene.search.AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier
- Enclosing class:
AbstractVectorSimilarityQuery
private static class AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier
extends ScorerSupplier
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final float[]
(package private) final DocIdSetIterator
-
Constructor Summary
ConstructorsConstructorDescriptionVectorSimilarityScorerSupplier
(DocIdSetIterator iterator, float[] cachedScore) -
Method Summary
Modifier and TypeMethodDescriptionlong
cost()
Get an estimate of theScorer
that would be returned byScorerSupplier.get(long)
.(package private) static AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier
fromAcceptDocs
(float boost, VectorScorer scorer, DocIdSetIterator acceptDocs, float threshold) (package private) static AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier
fromScoreDocs
(float boost, ScoreDoc[] scoreDocs) get
(long leadCost) Get theScorer
.Methods inherited from class org.apache.lucene.search.ScorerSupplier
bulkScorer, setTopLevelScoringClause
-
Field Details
-
iterator
-
cachedScore
final float[] cachedScore
-
-
Constructor Details
-
VectorSimilarityScorerSupplier
VectorSimilarityScorerSupplier(DocIdSetIterator iterator, float[] cachedScore)
-
-
Method Details
-
fromScoreDocs
static AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier fromScoreDocs(float boost, ScoreDoc[] scoreDocs) -
fromAcceptDocs
static AbstractVectorSimilarityQuery.VectorSimilarityScorerSupplier fromAcceptDocs(float boost, VectorScorer scorer, DocIdSetIterator acceptDocs, float threshold) -
get
Description copied from class:ScorerSupplier
Get theScorer
. This may not returnnull
and must be called at most once.- Specified by:
get
in classScorerSupplier
- Parameters:
leadCost
- Cost of the scorer that will be used in order to lead iteration. This can be interpreted as an upper bound of the number of times thatDocIdSetIterator.nextDoc()
,DocIdSetIterator.advance(int)
andTwoPhaseIterator.matches()
will be called. Under doubt, passLong.MAX_VALUE
, which will produce aScorer
that has good iteration capabilities.
-
cost
public long cost()Description copied from class:ScorerSupplier
Get an estimate of theScorer
that would be returned byScorerSupplier.get(long)
. This may be a costly operation, so it should only be called if necessary.- Specified by:
cost
in classScorerSupplier
- See Also:
-