SearchModelFactory.HnswParameters Method

Definition

Contains the parameters specific to the HNSW algorithm.

public static Azure.Search.Documents.Indexes.Models.HnswParameters HnswParameters(int? m = default, int? efConstruction = default, int? efSearch = default, Azure.Search.Documents.Indexes.Models.VectorSearchAlgorithmMetric? metric = default);
static member HnswParameters : Nullable<int> * Nullable<int> * Nullable<int> * Nullable<Azure.Search.Documents.Indexes.Models.VectorSearchAlgorithmMetric> -> Azure.Search.Documents.Indexes.Models.HnswParameters
Public Shared Function HnswParameters (Optional m As Nullable(Of Integer) = Nothing, Optional efConstruction As Nullable(Of Integer) = Nothing, Optional efSearch As Nullable(Of Integer) = Nothing, Optional metric As Nullable(Of VectorSearchAlgorithmMetric) = Nothing) As HnswParameters

Parameters

m
Nullable<Int32>

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.

efConstruction
Nullable<Int32>

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.

efSearch
Nullable<Int32>

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.

metric
Nullable<VectorSearchAlgorithmMetric>

The similarity metric to use for vector comparisons.

Returns

A new HnswParameters instance for mocking.

Applies to