public class VSimArgs extends Object implements CompositeArgument
VSimArgs.Builder and call the methods: count(…) .
VSimArgs is a mutable object and instances should be used only once to avoid shared mutable state.
| Modifier and Type | Class and Description |
|---|---|
static class |
VSimArgs.Builder
Builder entry points for
VSimArgs. |
| Constructor and Description |
|---|
VSimArgs() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> void |
build(CommandArgs<K,V> args)
Build command arguments and contribute arguments to
CommandArgs. |
VSimArgs |
count(Long count)
Set the number of results to return.
|
VSimArgs |
epsilon(double delta)
Sets the EPSILON distance cutoff for approximate vector similarity matching; results must have similarity ≥ 1 − epsilon.
|
VSimArgs |
explorationFactor(Long explorationFactor)
Set the exploration factor for the vector search.
|
VSimArgs |
filter(String filter)
Set the filter expression to apply.
|
VSimArgs |
filterEfficiency(Long filterEfficiency)
Set the filter efficiency to use.
|
VSimArgs |
noThread()
Disable threading for the vector search.
|
VSimArgs |
noThread(boolean noThread)
Enable or disable threading for the vector search.
|
VSimArgs |
truth()
Enable truth mode for the vector search.
|
VSimArgs |
truth(boolean truth)
Enable or disable truth mode for the vector search.
|
public VSimArgs count(Long count)
The COUNT option limits the number of returned results to the specified value. This is useful when you only need a specific number of the most similar elements.
Time complexity: O(log(N)) where N is the number of elements in the vector set.
count - the number of results to return.thispublic VSimArgs explorationFactor(Long explorationFactor)
The EF (exploration factor) option controls the search effort. Higher values explore more nodes, improving recall at the cost of speed. Typical values range from 50 to 1000.
Increasing this value will generally improve search quality but reduce performance.
explorationFactor - the exploration factor for the vector search.thispublic VSimArgs filter(String filter)
The FILTER option applies a filter expression to restrict matching elements. Filter expressions can be used to narrow down search results based on attributes associated with the vector elements.
For example, a filter like "price < 100" would only return elements with a price attribute less than 100.
filter - the filter expression to apply.thispublic VSimArgs filterEfficiency(Long filterEfficiency)
The FILTER-EF option limits the number of filtering attempts for the FILTER expression. This controls the maximum effort spent on filtering during the search process.
Higher values will spend more effort trying to find elements that match the filter, potentially improving recall for filtered searches at the cost of performance.
filterEfficiency - the maximum filtering effort to use.thispublic VSimArgs truth()
The TRUTH option forces an exact linear scan of all elements, bypassing the HNSW graph. This is useful for benchmarking or to calculate recall. Note that this is significantly slower with a time complexity of O(N) instead of O(log(N)).
This option is primarily intended for testing and evaluation purposes.
thispublic VSimArgs truth(boolean truth)
The TRUTH option forces an exact linear scan of all elements, bypassing the HNSW graph. This is useful for benchmarking or to calculate recall. Note that this is significantly slower with a time complexity of O(N) instead of O(log(N)).
This option is primarily intended for testing and evaluation purposes.
truth - whether to enable truth mode.thispublic VSimArgs noThread()
The NOTHREAD option executes the search in the main thread instead of a background thread. This is useful for small vector sets or benchmarks, but may block the server during execution and increase server latency.
Use this option with caution in production environments.
thispublic VSimArgs noThread(boolean noThread)
The NOTHREAD option executes the search in the main thread instead of a background thread. This is useful for small vector sets or benchmarks, but may block the server during execution and increase server latency.
Use this option with caution in production environments.
noThread - whether to disable threading.thispublic VSimArgs epsilon(double delta)
delta - the similarity threshold delta value, must be within [0.0, 1.0] inclusivethisIllegalArgumentException - if delta is outside the valid range [0.0, 1.0]public <K,V> void build(CommandArgs<K,V> args)
CompositeArgumentCommandArgs.
Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
build in interface CompositeArgumentK - Key type.V - Value type.args - the command arguments, must not be null.Copyright © 2025 lettuce.io. All rights reserved.