All Products
Search
Document Center

OpenSearch:HNSW configurations

Last Updated:Apr 01, 2026

Hierarchical Navigable Small World (HNSW) is a graph-based approximate nearest neighbor (ANN) algorithm used by OpenSearch Retrieval Engine Edition for vector search. This reference describes the parameters that control index building and search behavior.

Index building parameters

ParameterTypeDefaultDescription
proxima.hnsw.builder.max_neighbor_countuint32100The maximum number of neighbors per node in the graph. Higher values improve graph connectivity but increase index size and build time.
proxima.hnsw.builder.efconstructionuint32500The size of the candidate pool scanned when inserting each node during index building. Higher values produce a higher-quality graph but slow down index building. Start with 400 for initial testing.
proxima.hnsw.builder.thread_countuint320The number of threads used for index building. When set to 0, defaults to the number of CPU cores on the OpenSearch Retrieval Engine Edition instance.

HnswSearcher parameters

ParameterTypeDefaultDescription
proxima.hnsw.searcher.efuint32500The number of nearest neighbor candidates scanned during a search. Higher values increase the retrieval ratio but slow down queries. Set within the range [100, 1000] based on your retrieval ratio and latency requirements.