Module org.elasticsearch.server
Class BinaryDenseVector
java.lang.Object
org.elasticsearch.script.field.vectors.BinaryDenseVector
- All Implemented Interfaces:
- DenseVector
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected float[]protected final intprotected final org.apache.lucene.util.BytesRefprotected final VersionFields inherited from interface org.elasticsearch.script.field.vectors.DenseVectorEMPTY
- 
Constructor SummaryConstructorsConstructorDescriptionBinaryDenseVector(org.apache.lucene.util.BytesRef docVector, int dims, Version indexVersion) 
- 
Method SummaryModifier and TypeMethodDescriptiondoublecosineSimilarity(float[] queryVector, boolean normalizeQueryVector) Get the cosine similarity with the query vectordoublecosineSimilarity(List<Number> queryVector) Get the cosine similarity with the un-normalized query vectordoubledotProduct(float[] queryVector) doubledotProduct(List<Number> queryVector) intgetDims()floatfloat[]booleanisEmpty()doublel1Norm(float[] queryVector) doubledoublel2Norm(float[] queryVector) doubleintsize()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.script.field.vectors.DenseVectorcosineSimilarity, cosineSimilarity, dotProduct, l1Norm, l2Norm
- 
Field Details- 
docVectorprotected final org.apache.lucene.util.BytesRef docVector
- 
dimsprotected final int dims
- 
indexVersion
- 
decodedDocVectorprotected float[] decodedDocVector
 
- 
- 
Constructor Details- 
BinaryDenseVector
 
- 
- 
Method Details- 
getVectorpublic float[] getVector()- Specified by:
- getVectorin interface- DenseVector
 
- 
getMagnitudepublic float getMagnitude()- Specified by:
- getMagnitudein interface- DenseVector
 
- 
dotProductpublic double dotProduct(float[] queryVector) - Specified by:
- dotProductin interface- DenseVector
 
- 
dotProduct- Specified by:
- dotProductin interface- DenseVector
 
- 
l1Normpublic double l1Norm(float[] queryVector) - Specified by:
- l1Normin interface- DenseVector
 
- 
l1Norm- Specified by:
- l1Normin interface- DenseVector
 
- 
l2Normpublic double l2Norm(float[] queryVector) - Specified by:
- l2Normin interface- DenseVector
 
- 
l2Norm- Specified by:
- l2Normin interface- DenseVector
 
- 
cosineSimilaritypublic double cosineSimilarity(float[] queryVector, boolean normalizeQueryVector) Description copied from interface:DenseVectorGet the cosine similarity with the query vector- Specified by:
- cosineSimilarityin interface- DenseVector
- normalizeQueryVector- - normalize the query vector, does not change the contents of passed in query vector
 
- 
cosineSimilarityDescription copied from interface:DenseVectorGet the cosine similarity with the un-normalized query vector- Specified by:
- cosineSimilarityin interface- DenseVector
 
- 
sizepublic int size()- Specified by:
- sizein interface- DenseVector
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- DenseVector
 
- 
getDimspublic int getDims()- Specified by:
- getDimsin interface- DenseVector
 
 
-