Class HnswParameters
java.lang.Object
com.azure.search.documents.indexes.models.HnswParameters
- All Implemented Interfaces:
com.azure.json.JsonSerializable<HnswParameters>
public final class HnswParameters
extends Object
implements com.azure.json.JsonSerializable<HnswParameters>
Contains the parameters specific to the HNSW algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HnswParametersfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of HnswParameters from the JsonReader.Get the efConstruction property: The size of the dynamic list containing the nearest neighbors, which is used during index time.Get the efSearch property: The size of the dynamic list containing the nearest neighbors, which is used during search time.getM()Get the m property: The number of bi-directional links created for every new element during construction.Get the metric property: The similarity metric to use for vector comparisons.setEfConstruction(Integer efConstruction) Set the efConstruction property: The size of the dynamic list containing the nearest neighbors, which is used during index time.setEfSearch(Integer efSearch) Set the efSearch property: The size of the dynamic list containing the nearest neighbors, which is used during search time.Set the m property: The number of bi-directional links created for every new element during construction.setMetric(VectorSearchAlgorithmMetric metric) Set the metric property: The similarity metric to use for vector comparisons.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
HnswParameters
public HnswParameters()Creates an instance of HnswParameters class.
-
-
Method Details
-
getM
Get the m property: The number of bi-directional links created for every new element during construction. Increasing this parameter value may improve recall and reduce retrieval times for datasets with high intrinsic dimensionality at the expense of increased memory consumption and longer indexing time.- Returns:
- the m value.
-
setM
Set the m property: The number of bi-directional links created for every new element during construction. Increasing this parameter value may improve recall and reduce retrieval times for datasets with high intrinsic dimensionality at the expense of increased memory consumption and longer indexing time.- Parameters:
m- the m value to set.- Returns:
- the HnswParameters object itself.
-
getEfConstruction
Get the efConstruction property: The size of the dynamic list containing the nearest neighbors, which is used during index time. Increasing this parameter may improve index quality, at the expense of increased indexing time. At a certain point, increasing this parameter leads to diminishing returns.- Returns:
- the efConstruction value.
-
setEfConstruction
Set the efConstruction property: The size of the dynamic list containing the nearest neighbors, which is used during index time. Increasing this parameter may improve index quality, at the expense of increased indexing time. At a certain point, increasing this parameter leads to diminishing returns.- Parameters:
efConstruction- the efConstruction value to set.- Returns:
- the HnswParameters object itself.
-
getEfSearch
Get the efSearch property: The size of the dynamic list containing the nearest neighbors, which is used during search time. Increasing this parameter may improve search results, at the expense of slower search. At a certain point, increasing this parameter leads to diminishing returns.- Returns:
- the efSearch value.
-
setEfSearch
Set the efSearch property: The size of the dynamic list containing the nearest neighbors, which is used during search time. Increasing this parameter may improve search results, at the expense of slower search. At a certain point, increasing this parameter leads to diminishing returns.- Parameters:
efSearch- the efSearch value to set.- Returns:
- the HnswParameters object itself.
-
getMetric
Get the metric property: The similarity metric to use for vector comparisons.- Returns:
- the metric value.
-
setMetric
Set the metric property: The similarity metric to use for vector comparisons.- Parameters:
metric- the metric value to set.- Returns:
- the HnswParameters object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<HnswParameters>- Throws:
IOException
-
fromJson
Reads an instance of HnswParameters from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of HnswParameters if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the HnswParameters.
-