Module org.elasticsearch.server
Class DenormalizedCosineFloatVectorValues
java.lang.Object
org.apache.lucene.search.DocIdSetIterator
org.apache.lucene.index.FloatVectorValues
org.elasticsearch.index.mapper.vectors.DenormalizedCosineFloatVectorValues
public class DenormalizedCosineFloatVectorValues
extends org.apache.lucene.index.FloatVectorValues
Provides the denormalized vectors. Float vectors stored with cosine similarity are normalized by default. So when reading the value
for scripts, we to denormalize them.
-
Field Summary
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
-
Constructor Summary
ConstructorsConstructorDescriptionDenormalizedCosineFloatVectorValues
(org.apache.lucene.index.FloatVectorValues in, org.apache.lucene.index.NumericDocValues magnitudeIn) -
Method Summary
Methods inherited from class org.apache.lucene.index.FloatVectorValues
cost
Methods inherited from class org.apache.lucene.search.DocIdSetIterator
all, empty, range, slowAdvance
-
Constructor Details
-
DenormalizedCosineFloatVectorValues
public DenormalizedCosineFloatVectorValues(org.apache.lucene.index.FloatVectorValues in, org.apache.lucene.index.NumericDocValues magnitudeIn)
-
-
Method Details
-
dimension
public int dimension()- Specified by:
dimension
in classorg.apache.lucene.index.FloatVectorValues
-
size
public int size()- Specified by:
size
in classorg.apache.lucene.index.FloatVectorValues
-
vectorValue
- Specified by:
vectorValue
in classorg.apache.lucene.index.FloatVectorValues
- Throws:
IOException
-
docID
public int docID()- Specified by:
docID
in classorg.apache.lucene.search.DocIdSetIterator
-
nextDoc
- Specified by:
nextDoc
in classorg.apache.lucene.search.DocIdSetIterator
- Throws:
IOException
-
advance
- Specified by:
advance
in classorg.apache.lucene.search.DocIdSetIterator
- Throws:
IOException
-
magnitude
public float magnitude()
-