| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Query |
build()
Builds the Query object.
|
Query.Builder |
setColumn(String column)
Sets the column to be searched.
|
Query.Builder |
setDistanceType(DistanceType distanceType)
Sets the distance metric type.
|
Query.Builder |
setEf(int ef)
Sets the number of candidates to reserve while searching.
|
Query.Builder |
setK(int k)
Sets the number of top results to return.
|
Query.Builder |
setKey(float[] key)
Sets the vector to be searched.
|
Query.Builder |
setMaximumNprobes(int maximumNprobes)
Sets the maximum number of partitions to search.
|
Query.Builder |
setMinimumNprobes(int minimumNprobes)
Sets the minimum number of partitions to search.
|
Query.Builder |
setNprobes(int nprobes)
Sets the number of probes to load and search.
|
Query.Builder |
setRefineFactor(int refineFactor)
Sets the refine factor for applying a refine step.
|
Query.Builder |
setUseIndex(boolean useIndex)
Sets whether to use an ANN index if available.
|
public Query.Builder setColumn(String column)
column - The name of the column to search in.public Query.Builder setKey(float[] key)
key - The search vector.public Query.Builder setK(int k)
k - The number of top results to return.public Query.Builder setNprobes(int nprobes)
This is a convenience method that sets both the minimum and maximum number of probes to the same value.
nprobes - The number of probes.public Query.Builder setMinimumNprobes(int minimumNprobes)
This many partitions will always be loaded and searched on the query. Increasing this number can improve recall at the cost of latency.
minimumNprobes - The minimum number of partitions to search.public Query.Builder setMaximumNprobes(int maximumNprobes)
These partitions will only be loaded and searched if we have not found the desired number of results after searching the minimum number of partitions. Increasing this number can avoid false negatives on queries with a highly selective prefilter. This setting does not affect the recall of the query and will only affect the latency if the prefilter is highly selective.
maximumNprobes - The maximum number of partitions to search.public Query.Builder setEf(int ef)
ef - The number of candidates to reserve.public Query.Builder setRefineFactor(int refineFactor)
refineFactor - The refine factor.public Query.Builder setDistanceType(DistanceType distanceType)
distanceType - The DistanceType to use for the query.public Query.Builder setUseIndex(boolean useIndex)
useIndex - True to use the index, false otherwise.public Query build()
IllegalStateException - if any required fields are not set or have invalid values.Copyright © 2025. All rights reserved.