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
checkField, costMethods 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:
dimensionin classorg.apache.lucene.index.FloatVectorValues
-
size
public int size()- Specified by:
sizein classorg.apache.lucene.index.FloatVectorValues
-
vectorValue
- Specified by:
vectorValuein classorg.apache.lucene.index.FloatVectorValues- Throws:
IOException
-
docID
public int docID()- Specified by:
docIDin classorg.apache.lucene.search.DocIdSetIterator
-
nextDoc
- Specified by:
nextDocin classorg.apache.lucene.search.DocIdSetIterator- Throws:
IOException
-
advance
- Specified by:
advancein classorg.apache.lucene.search.DocIdSetIterator- Throws:
IOException
-
scorer
- Specified by:
scorerin classorg.apache.lucene.index.FloatVectorValues- Throws:
IOException
-
magnitude
public float magnitude()
-