## Uses of Class
org.apache.lucene.index.VectorSimilarityFunction

- Packages that use VectorSimilarityFunction
  Package | Description
  --- | ---
  org.apache.lucene.codecs.lucene99 | Lucene 9.9 file format.
  org.apache.lucene.document | The logical representation of a `Document` for indexing and searching.
  org.apache.lucene.index | Code to maintain and access indices.
  org.apache.lucene.util.hnsw | Navigable Small-World graph, nominally Hierarchical but currently only has a single layer.
  org.apache.lucene.util.quantization | Provides quantization methods for scaling vector values to smaller data types and possibly fewer dimensions

- - ### Uses of VectorSimilarityFunction in org.apache.lucene.codecs.lucene99

    Methods in org.apache.lucene.codecs.lucene99 that return VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `static VectorSimilarityFunction` | Lucene99HnswVectorsReader.`readSimilarityFunction​(DataInput input)` |

  - ### Uses of VectorSimilarityFunction in org.apache.lucene.document

    Methods in org.apache.lucene.document that return VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `VectorSimilarityFunction` | FieldType.`vectorSimilarityFunction()` |

    Methods in org.apache.lucene.document with parameters of type VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `static FieldType` | KnnByteVectorField.`createFieldType​(int dimension, VectorSimilarityFunction similarityFunction)` | A convenience method for creating a vector field type.
    `static FieldType` | KnnFloatVectorField.`createFieldType​(int dimension, VectorSimilarityFunction similarityFunction)` | A convenience method for creating a vector field type.
    `void` | FieldType.`setVectorAttributes​(int numDimensions, VectorEncoding encoding, VectorSimilarityFunction similarity)` | Enable vector indexing, with the specified number of dimensions and distance function.

    Constructors in org.apache.lucene.document with parameters of type VectorSimilarityFunction
    Constructor | Description
    --- | ---
    `KnnByteVectorField​(String name, byte[] vector, VectorSimilarityFunction similarityFunction)` | Creates a numeric vector field.
    `KnnFloatVectorField​(String name, float[] vector, VectorSimilarityFunction similarityFunction)` | Creates a numeric vector field.
    `KnnVectorField​(String name, float[] vector, VectorSimilarityFunction similarityFunction)` | Deprecated. Creates a numeric vector field.

  - ### Uses of VectorSimilarityFunction in org.apache.lucene.index

    Methods in org.apache.lucene.index that return VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `VectorSimilarityFunction` | FieldInfo.`getVectorSimilarityFunction()` | Returns `VectorSimilarityFunction` for the field
    `static VectorSimilarityFunction` | VectorSimilarityFunction.`valueOf​(String name)` | Returns the enum constant of this type with the specified name.
    `static VectorSimilarityFunction[]` | VectorSimilarityFunction.`values()` | Returns an array containing the constants of this enum type, in the order they are declared.
    `VectorSimilarityFunction` | IndexableFieldType.`vectorSimilarityFunction()` | The `VectorSimilarityFunction` of the field's vector value

    Constructors in org.apache.lucene.index with parameters of type VectorSimilarityFunction
    Constructor | Description
    --- | ---
    `FieldInfo​(String name, int number, boolean storeTermVector, boolean omitNorms, boolean storePayloads, IndexOptions indexOptions, DocValuesType docValues, long dvGen, Map<String,​String> attributes, int pointDimensionCount, int pointIndexDimensionCount, int pointNumBytes, int vectorDimension, VectorEncoding vectorEncoding, VectorSimilarityFunction vectorSimilarityFunction, boolean softDeletesField, boolean isParentField)` | Sole constructor.

  - ### Uses of VectorSimilarityFunction in org.apache.lucene.util.hnsw

    Methods in org.apache.lucene.util.hnsw with parameters of type VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `static RandomVectorScorer` | RandomVectorScorer.`createBytes​(RandomAccessVectorValues<byte[]> vectors, VectorSimilarityFunction similarityFunction, byte[] query)` | Creates a default scorer for byte vectors.
    `static RandomVectorScorerSupplier` | RandomVectorScorerSupplier.`createBytes​(RandomAccessVectorValues<byte[]> vectors, VectorSimilarityFunction similarityFunction)` | Creates a `RandomVectorScorerSupplier` to compare byte vectors.
    `static RandomVectorScorer` | RandomVectorScorer.`createFloats​(RandomAccessVectorValues<float[]> vectors, VectorSimilarityFunction similarityFunction, float[] query)` | Creates a default scorer for float vectors.
    `static RandomVectorScorerSupplier` | RandomVectorScorerSupplier.`createFloats​(RandomAccessVectorValues<float[]> vectors, VectorSimilarityFunction similarityFunction)` | Creates a `RandomVectorScorerSupplier` to compare float vectors.

  - ### Uses of VectorSimilarityFunction in org.apache.lucene.util.quantization

    Methods in org.apache.lucene.util.quantization with parameters of type VectorSimilarityFunction
    Modifier and Type | Method | Description
    --- | --- | ---
    `static ScalarQuantizedVectorSimilarity` | ScalarQuantizedVectorSimilarity.`fromVectorSimilarity​(VectorSimilarityFunction sim, float constMultiplier)` | Creates a `ScalarQuantizedVectorSimilarity` from a `VectorSimilarityFunction` and the constant multiplier used for quantization.
    `float` | ScalarQuantizer.`quantize​(float[] src, byte[] dest, VectorSimilarityFunction similarityFunction)` | Quantize a float vector into a byte vector
    `static float` | ScalarQuantizedRandomVectorScorer.`quantizeQuery​(float[] query, byte[] quantizedQuery, VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer)` |
    `float` | ScalarQuantizer.`recalculateCorrectiveOffset​(byte[] quantizedVector, ScalarQuantizer oldQuantizer, VectorSimilarityFunction similarityFunction)` | Recalculate the old score corrective value given new current quantiles

    Constructors in org.apache.lucene.util.quantization with parameters of type VectorSimilarityFunction
    Constructor | Description
    --- | ---
    `ScalarQuantizedRandomVectorScorer​(VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer, RandomAccessQuantizedByteVectorValues values, float[] query)` |
    `ScalarQuantizedRandomVectorScorerSupplier​(VectorSimilarityFunction similarityFunction, ScalarQuantizer scalarQuantizer, RandomAccessQuantizedByteVectorValues values)` |