BruteForceQuery
Java package: com.nvidia.cuvs
BruteForceQuery holds the query vectors to be used while invoking search.
Thread Safety: Each BruteForceQuery instance should use its own CuVSResources object that is not shared with other threads. Sharing CuVSResources between threads can lead to memory allocation errors or JVM crashes.
Public Members
BruteForceQuery
Constructs an instance of BruteForceQuery using queryVectors,
mapping, and topK.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:42
getQueryVectors
Gets the query vector 2D float array.
Returns
2D float array
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:62
getMapping
Gets the function mapping ordinals (neighbor IDs) to custom user IDs
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:69
getTopK
Gets the topK value.
Returns
an integer
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:78
getPrefilters
Gets the prefilter long array
Returns
an array of bitsets
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:87
getNumDocs
Gets the number of documents supposed to be in this index, as used for prefilters
Returns
number of documents as an integer
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:96
getResources
Gets the CuVSResources instance for this query.
Returns
the CuVSResources instance
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:105
Builder
Constructor that requires CuVSResources.
Important: The provided CuVSResources instance should not be shared with other threads. Each thread performing searches should create its own CuVSResources instance to avoid memory allocation conflicts and potential JVM crashes.
Parameters
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:143
withQueryVectors
Registers the query vectors to be passed in the search call.
Parameters
Returns
an instance of this Builder
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:153
withMapping
Sets the function used to map ordinals (neighbor IDs) to custom user IDs
Parameters
Returns
an instance of this Builder
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:164
withTopK
Registers the topK value.
Parameters
Returns
an instance of this Builder
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:175
withPrefilters
Sets the prefilters data for building the BruteForceQuery.
Parameters
Returns
an instance of this Builder
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:187
build
Builds an instance of BruteForceQuery
Returns
an instance of BruteForceQuery
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:198
Source: java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java:21