public class QueryResponseWithUnsignedIndices
extends java.lang.Object
ScoredVector objects in the `matches` list
contain SparseValuesWithUnsignedIndices instead of the standard SparseValues.
The QueryResponseWithUnsignedIndices class contains the following fields:
- matches: a list of ScoredVectorWithUnsignedIndices objects, representing the matching vectors
- namespace: the namespace of the index to retrieve search results from
- usage: the usage information for the queryS
The class provides a constructor that takes a QueryResponse object and converts it to a
QueryResponseWithUnsignedIndices object, as well as getter and setter methods for each of the fields.
It also includes a method to convert a list of `ScoredVector` objects to a list of
ScoredVectorWithUnsignedIndices objects.
| Constructor and Description |
|---|
QueryResponseWithUnsignedIndices(QueryResponse queryResponse)
Constructs a
QueryResponseWithUnsignedIndices object from a QueryResponse object, converting the
`ScoredVector` objects to ScoredVectorWithUnsignedIndices objects. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ScoredVectorWithUnsignedIndices> |
convertToScoredVectorWithUnsignedIndices(java.util.List<ScoredVector> matches)
Converts a list of
ScoredVector objects to a list of ScoredVectorWithUnsignedIndices objects. |
ScoredVectorWithUnsignedIndices |
getMatches(int index)
Returns the
ScoredVectorWithUnsignedIndices object at the specified index in the `matches` list. |
java.util.List<ScoredVectorWithUnsignedIndices> |
getMatchesList()
Returns the list of matching vectors, where each vector contains sparse values with unsigned 32-bit integer indices.
|
java.lang.String |
getNamespace()
Returns the namespace of the query.
|
Usage |
getUsage()
Returns the usage information for the query.
|
void |
setMatches(java.util.List<ScoredVectorWithUnsignedIndices> matches)
Sets the list of matching vectors, where each vector contains sparse values with unsigned 32-bit integer indices.
|
void |
setNamespace(java.lang.String namespace)
Sets the namespace of the query.
|
void |
setUsage(Usage usage)
Sets the usage information for the query.
|
java.lang.String |
toString() |
public QueryResponseWithUnsignedIndices(QueryResponse queryResponse)
QueryResponseWithUnsignedIndices object from a QueryResponse object, converting the
`ScoredVector` objects to ScoredVectorWithUnsignedIndices objects.queryResponse - The QueryResponse object to convertpublic java.util.List<ScoredVectorWithUnsignedIndices> getMatchesList()
ScoredVectorWithUnsignedIndices objectspublic ScoredVectorWithUnsignedIndices getMatches(int index)
ScoredVectorWithUnsignedIndices object at the specified index in the `matches` list.index - The index of the ScoredVectorWithUnsignedIndices object to returnScoredVectorWithUnsignedIndices object at the specified indexpublic java.util.List<ScoredVectorWithUnsignedIndices> convertToScoredVectorWithUnsignedIndices(java.util.List<ScoredVector> matches)
ScoredVector objects to a list of ScoredVectorWithUnsignedIndices objects.matches - The list of ScoredVector objects to convertScoredVectorWithUnsignedIndices objectsjava.lang.IllegalArgumentException - If the matches list is nullpublic void setMatches(java.util.List<ScoredVectorWithUnsignedIndices> matches)
matches - The new list of ScoredVectorWithUnsignedIndices objectspublic java.lang.String getNamespace()
public void setNamespace(java.lang.String namespace)
namespace - The new namespacepublic Usage getUsage()
public void setUsage(Usage usage)
usage - The new usagepublic java.lang.String toString()
toString in class java.lang.Object