Package io.milvus.response
Class SearchResultsWrapper
- java.lang.Object
-
- io.milvus.response.basic.RowRecordWrapper
-
- io.milvus.response.SearchResultsWrapper
-
public class SearchResultsWrapper extends RowRecordWrapper
Utility class to wrap response ofsearch
interface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchResultsWrapper.IDScore
Internal-use class to wrap response ofsearch
interface.
-
Constructor Summary
Constructors Constructor Description SearchResultsWrapper(@NonNull io.milvus.grpc.SearchResultData results)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QueryResultsWrapper.RowRecord
buildRowRecord(long index)
Gets a row record from result.java.util.List<?>
getFieldData(@NonNull java.lang.String fieldName, int indexOfTarget)
Gets data for an output field which is specified by search request.protected java.util.List<io.milvus.grpc.FieldData>
getFieldDataList()
FieldDataWrapper
getFieldWrapper(@NonNull java.lang.String fieldName)
GetsFieldDataWrapper
for a field.java.util.List<SearchResultsWrapper.IDScore>
getIDScore(int indexOfTarget)
Gets ID-score pairs returned by search interface.protected java.util.List<java.lang.String>
getOutputFields()
java.util.List<QueryResultsWrapper.RowRecord>
getRowRecords()
-
Methods inherited from class io.milvus.response.basic.RowRecordWrapper
buildRowRecord, getDynamicWrapper
-
-
-
-
Method Detail
-
getFieldWrapper
public FieldDataWrapper getFieldWrapper(@NonNull @NonNull java.lang.String fieldName) throws ParamException
GetsFieldDataWrapper
for a field. ThrowsParamException
if the field doesn't exist.- Parameters:
fieldName
- field name to get output data- Returns:
FieldDataWrapper
- Throws:
ParamException
-
getRowRecords
public java.util.List<QueryResultsWrapper.RowRecord> getRowRecords()
- Specified by:
getRowRecords
in classRowRecordWrapper
-
buildRowRecord
protected QueryResultsWrapper.RowRecord buildRowRecord(long index)
Gets a row record from result. ThrowsParamException
if the index is illegal.- Returns:
RowRecord
a row record of the result
-
getFieldDataList
protected java.util.List<io.milvus.grpc.FieldData> getFieldDataList()
- Specified by:
getFieldDataList
in classRowRecordWrapper
-
getOutputFields
protected java.util.List<java.lang.String> getOutputFields()
- Specified by:
getOutputFields
in classRowRecordWrapper
-
getFieldData
public java.util.List<?> getFieldData(@NonNull @NonNull java.lang.String fieldName, int indexOfTarget)
Gets data for an output field which is specified by search request. ThrowsParamException
if the field doesn't exist. ThrowsParamException
if the indexOfTarget is illegal.- Parameters:
fieldName
- field name to get output dataindexOfTarget
- which target vector the field data belongs to- Returns:
FieldDataWrapper
-
getIDScore
public java.util.List<SearchResultsWrapper.IDScore> getIDScore(int indexOfTarget) throws ParamException, IllegalResponseException
Gets ID-score pairs returned by search interface. ThrowsParamException
if the indexOfTarget is illegal. ThrowsIllegalResponseException
if the returned results is illegal.- Parameters:
indexOfTarget
- which target vector the result belongs to- Returns:
- List of IDScore, ID-score pairs returned by search interface
- Throws:
ParamException
IllegalResponseException
-
-