public class ReciprocalDoubleValuesSource extends DoubleValuesSource
SCORES
Constructor and Description |
---|
ReciprocalDoubleValuesSource(double distToEdge,
DoubleValuesSource input)
Creates a ReciprocalDoubleValuesSource
|
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 ctx,
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.
|
java.lang.String |
toString() |
constant, fromDoubleField, fromField, fromFloatField, fromIntField, fromLongField, fromQuery, fromScorer, getSortField, toLongValuesSource
public ReciprocalDoubleValuesSource(double distToEdge, DoubleValuesSource input)
distToEdge
- the value k in v = k / (v + k)input
- the input DoubleValuesSource to transformpublic DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws java.io.IOException
DoubleValuesSource
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.getValues
in class DoubleValuesSource
java.io.IOException
public boolean needsScores()
DoubleValuesSource
needsScores
in class DoubleValuesSource
public boolean isCacheable(LeafReaderContext ctx)
true
if the object can be cached against a given leafpublic Explanation explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation) throws java.io.IOException
DoubleValuesSource
explain
in class DoubleValuesSource
ctx
- 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 DoubleValuesSource rewrite(IndexSearcher searcher) throws java.io.IOException
DoubleValuesSource
this
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 DoubleValuesSource
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class DoubleValuesSource
public int hashCode()
hashCode
in class DoubleValuesSource
public java.lang.String toString()
toString
in class DoubleValuesSource
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.