Vector Query
A vector search (SPEC.md §11.3): the k visible documents whose vectors are nearest to vector under the store's VectorField.metric, nearest first, in a store with a CreationOptions.vectorField.
vector: the query vector, of the field's dimensions; its numbers must be finite and, under VectorMetric.COSINE, not all zero. The query keeps a copy, and vector returns another.
maxDistance: when given, documents farther than it are left out, so a result can have fewer than k hits.
scan: what to do when the documentFilter's index terms narrow nothing (see JsonStore.explain).
documentFilter: only the documents it accepts are candidates; set with withDocumentFilter.
Queries are values: two instances with the same settings, the vector's numbers compared bit by bit, are equal, and copy derives a variant. Throws IllegalArgumentException for an empty vector, a number that isn't finite, a k outside 1..MAX_K and a maxDistance that is NaN.
Constructors
The k documents nearest to vector, within maxDistance when it's given.
Properties
How many numbers the query vector has, which must be the vector field's dimensions.
The condition a document has to meet to be a candidate (SPEC.md §10.5), or null for every document with a vector. A comparison of one of its root's members with a literal is an index term that narrows the candidates; a filter without one needs scan to be ScanPolicy.ALLOW_SCAN.
A copy of the query vector.
Functions
This query with the given settings changed, the documentFilter kept; the result is validated like a new instance.
This query with documentFilter set to filter, or removed with null.