Nearest-neighbor search fundamentals

Nearest-neighbor search fundamentals define the problem HNSW approximates: exact versus approximate neighbors, top-k and range search, candidates and reranking, filters, and the workload shapes that dominate production.
Created: Updated: 2 min read

These are the topics in this section, each on its own page with a stable path you can bookmark or share.

What topics are covered in this section?

Nearest-neighbor search fundamentals define the problem HNSW approximates: exact versus approximate neighbors, top-k and range search, candidates and reranking, filters, and the workload knobs N, d, k, and QPS.

What problem is HNSW solving?

Vector search and nearest-neighbor search ask for the closest points under a chosen measure. Exact search and ground truth set the quality bar; approximate nearest neighbor (ANN) and c-approximate or recall-based approximation trade a controlled miss rate for speed. Top-k, k-NN, and range search are different result shapes. Candidate generation plus reranking is the two-stage pattern many production stacks use – HNSW often plays the candidate role before a cross-encoder or exact rescore.

Filtered nearest-neighbor search, predicates, and pre-, post-, and integrated filtering explain how metadata constraints change the walk.

Which workload dimensions should you name explicitly?

Corpus size N, dimensionality d, result count k, and queries per second QPS are the axes of capacity planning. Ties in results and evaluation against ground truth keep benchmarks honest. Weaviate exposes vector, hybrid, and filtered query APIs on top of these fundamentals; choosing flat versus HNSW versus other index types is choosing how aggressively to approximate for your N and QPS.

Without this problem statement, parameter tuning has no north star.

What is a good next step?

Read vector search, ANN, recall-based approximation, and filtered search pages, then Part I’s opening chapter on why brute force fails. For database packaging of the same ideas, continue into persistence and applications hubs.

This section states the retrieval problem HNSW exists to solve. Next, read “What is approximate nearest-neighbor search (ANN)?” or Part I’s first chapter, then explore filtering terms when predicates enter the picture.