Table of Contents

Public classSealed 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

Public constructor VectorQuery(string, float[], int, int, int, Query?)

Initialises a new VectorQuery for the given field and query vector.

Properties

Public propertyRead-only 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).

Public propertyRead-only Field

Gets the primary field this query targets.

Public propertyRead-only Filter

Optional pre-filter restricting candidates to documents whose IDs satisfy the predicate.

Public propertyRead-only OversamplingFactor

Exact-rerank oversampling factor. The HNSW shortlist returns topK * OversamplingFactor candidates which are then exactly rescored. Default: 1 (no oversampling).

Public propertyRead-only QueryVector

Gets the query vector used to find approximate nearest neighbours.

Public propertyRead-only TopK

Gets the maximum number of nearest-neighbour results to return.

Methods

Public methodStatic CosineSimilarity(ReadOnlySpan<float>, ReadOnlySpan<float>)

Computes cosine similarity between two vectors using SIMD where available.

Public method Equals(object?)

Determines whether the specified object is equal to the current object.

Public method GetHashCode()

Serves as the default hash function.