HnswParameters Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. HnswParameters
- com.
Implements
public final class HnswParameters
implements JsonSerializable<HnswParameters>
Contains the parameters specific to the HNSW algorithm.
Constructor Summary
| Constructor | Description |
|---|---|
| HnswParameters() |
Creates an instance of Hnsw |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Hnsw |
fromJson(JsonReader jsonReader)
Reads an instance of Hnsw |
| Integer |
getEfConstruction()
Get the ef |
| Integer |
getEfSearch()
Get the ef |
| Integer |
getM()
Get the m property: The number of bi-directional links created for every new element during construction. |
|
Vector |
getMetric()
Get the metric property: The similarity metric to use for vector comparisons. |
|
Hnsw |
setEfConstruction(Integer efConstruction)
Set the ef |
|
Hnsw |
setEfSearch(Integer efSearch)
Set the ef |
|
Hnsw |
setM(Integer m)
Set the m property: The number of bi-directional links created for every new element during construction. |
|
Hnsw |
setMetric(VectorSearchAlgorithmMetric metric)
Set the metric property: The similarity metric to use for vector comparisons. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
HnswParameters
public HnswParameters()
Creates an instance of HnswParameters class.
Method Details
fromJson
public static HnswParameters fromJson(JsonReader jsonReader)
Reads an instance of HnswParameters from the JsonReader.
Parameters:
Returns:
Throws:
getEfConstruction
public Integer 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:
getEfSearch
public Integer 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:
getM
public Integer 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:
getMetric
public VectorSearchAlgorithmMetric getMetric()
Get the metric property: The similarity metric to use for vector comparisons.
Returns:
setEfConstruction
public HnswParameters setEfConstruction(Integer efConstruction)
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:
Returns:
setEfSearch
public HnswParameters setEfSearch(Integer efSearch)
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:
Returns:
setM
public HnswParameters setM(Integer m)
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:
Returns:
setMetric
public HnswParameters setMetric(VectorSearchAlgorithmMetric metric)
Set the metric property: The similarity metric to use for vector comparisons.
Parameters:
Returns: