
VectorQuery
- Namespace
- Rowles.LeanCorpus.Search.Queries
- Assembly
- Rowles.LeanCorpus.dll
ANN search over vector data using HNSW when available, with a flat SIMD fallback.
public sealed class VectorQuery : Query, IEquatable<Query>
- Inheritance
-
VectorQuery
- Implements
- Inherited Members
- Extension Methods
VectorQuery(string, float[], int, int, int, Query?)
Initialises a new VectorQuery for the given field and query vector.
EfSearch
HNSW search-time candidate pool size (the ef parameter). Larger values increase recall at
the cost of latency. Defaults to max(64, 4 * topK).
Field
Gets the single field this query targets, or an empty value for fieldless and multi-field queries.
Filter
Optional pre-filter restricting candidates to documents whose IDs satisfy the predicate.
OversamplingFactor
Exact-rerank oversampling factor. The HNSW shortlist returns topK * OversamplingFactor
candidates 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.
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.
Visit(QueryVisitor)
Visits this query and its children.