
VectorQuery
- Namespace
- Rowles.LeanLucene.Search.Queries
- Assembly
- Rowles.LeanLucene.dll
ANN search over vector data using HNSW when available, with a flat SIMD fallback.
public sealed class VectorQuery : Query, IEquatable<Query>
- Inheritance
-
VectorQuery
- Inherited Members
- Extension Methods
Constructors
VectorQuery(string, float[], int, int, int, Query?)
Initialises a new VectorQuery for the given field and query vector.
Properties
EfSearch
HNSW search-time candidate pool size (the
efparameter). Larger values increase recall at the cost of latency. Defaults tomax(64, 4 * topK).
Field
Gets the primary field this query targets.
Filter
Optional pre-filter restricting candidates to documents whose IDs satisfy the predicate.
OversamplingFactor
Exact-rerank oversampling factor. The HNSW shortlist returns
topK * OversamplingFactorcandidates which are then exactly rescored. Default: 1 (no oversampling).
QueryVector
Gets the query vector used to find approximate nearest neighbours.
TopK
Gets the maximum number of nearest-neighbour results to return.
Methods
CosineSimilarity(ReadOnlySpan<float>, ReadOnlySpan<float>)
Computes cosine similarity between two vectors using SIMD where available.
Equals(object?)
Determines whether the specified object is equal to the current object.
GetHashCode()
Serves as the default hash function.