public abstract class BBoxSimilarityValueSource extends DoubleValuesSource
ShapeValuesSource returning a Rectangle per-document.
Implementers: remember to implement equals and hashCode if you have fields!
SCORES| Constructor and Description |
|---|
BBoxSimilarityValueSource(ShapeValuesSource bboxValueSource) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
Explanation |
explain(LeafReaderContext ctx,
int docId,
Explanation scoreExplanation)
An explanation of the value for the named document.
|
DoubleValues |
getValues(LeafReaderContext readerContext,
DoubleValues scores)
Returns a
DoubleValues instance for the passed-in LeafReaderContext and scores
If scores are not needed to calculate the values (ie returns false, callers
may safely pass null for the scores parameter. |
int |
hashCode() |
boolean |
isCacheable(LeafReaderContext ctx) |
boolean |
needsScores()
Return true if document scores are needed to calculate values
|
DoubleValuesSource |
rewrite(IndexSearcher searcher)
Return a DoubleValuesSource specialised for the given IndexSearcher
Implementations should assume that this will only be called once.
|
protected abstract double |
score(org.locationtech.spatial4j.shape.Rectangle rect,
java.util.concurrent.atomic.AtomicReference<Explanation> exp)
Return a relevancy score.
|
protected abstract java.lang.String |
similarityDescription()
A comma-separated list of configurable items of the subclass to put into
toString(). |
java.lang.String |
toString() |
constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSourcepublic BBoxSimilarityValueSource(ShapeValuesSource bboxValueSource)
public DoubleValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
DoubleValuesSourcethis
Queries that use DoubleValuesSource objects should call rewrite() during
Query.createWeight(IndexSearcher, boolean, float) rather than during
Query.rewrite(IndexReader) to avoid IndexReader reference leakagerewrite in class DoubleValuesSourcejava.io.IOExceptionpublic java.lang.String toString()
toString in class DoubleValuesSourceprotected abstract java.lang.String similarityDescription()
toString().public DoubleValues getValues(LeafReaderContext readerContext, DoubleValues scores) throws java.io.IOException
DoubleValuesSourceDoubleValues instance for the passed-in LeafReaderContext and scores
If scores are not needed to calculate the values (ie returns false, callers
may safely pass null for the scores parameter.getValues in class DoubleValuesSourcejava.io.IOExceptionprotected abstract double score(org.locationtech.spatial4j.shape.Rectangle rect,
java.util.concurrent.atomic.AtomicReference<Explanation> exp)
exp is provided then diagnostic information is added.rect - The indexed rectangle; not null.exp - Optional diagnostic holder.public boolean equals(java.lang.Object o)
equals in class DoubleValuesSourcepublic int hashCode()
hashCode in class DoubleValuesSourcepublic Explanation explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation) throws java.io.IOException
DoubleValuesSourceexplain in class DoubleValuesSourcectx - the readers context to create the Explanation for.docId - the document's id relative to the given context's readerjava.io.IOException - if an IOException occurspublic boolean isCacheable(LeafReaderContext ctx)
true if the object can be cached against a given leafpublic boolean needsScores()
DoubleValuesSourceneedsScores in class DoubleValuesSourceCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.