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 ofsearchinterface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSearchResultsWrapper.IDScoreInternal-use class to wrap response ofsearchinterface.
-
Constructor Summary
Constructors Constructor Description SearchResultsWrapper(@NonNull SearchResultData results)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QueryResultsWrapper.RowRecordbuildRowRecord(long index)Gets a row record from result.List<?>getFieldData(@NonNull String fieldName, int indexOfTarget)Gets data for an output field which is specified by search request.protected List<FieldData>getFieldDataList()FieldDataWrappergetFieldWrapper(@NonNull String fieldName)GetsFieldDataWrapperfor a field.List<SearchResultsWrapper.IDScore>getIDScore(int indexOfTarget)Gets ID-score pairs returned by search interface.protected List<String>getOutputFields()List<QueryResultsWrapper.RowRecord>getRowRecords()-
Methods inherited from class io.milvus.response.basic.RowRecordWrapper
buildRowRecord, getDynamicWrapper
-
-
-
-
Constructor Detail
-
SearchResultsWrapper
public SearchResultsWrapper(@NonNull @NonNull SearchResultData results)
-
-
Method Detail
-
getFieldWrapper
public FieldDataWrapper getFieldWrapper(@NonNull @NonNull String fieldName) throws ParamException
GetsFieldDataWrapperfor a field. ThrowsParamExceptionif the field doesn't exist.- Parameters:
fieldName- field name to get output data- Returns:
FieldDataWrapper- Throws:
ParamException
-
getRowRecords
public List<QueryResultsWrapper.RowRecord> getRowRecords()
- Specified by:
getRowRecordsin classRowRecordWrapper
-
buildRowRecord
protected QueryResultsWrapper.RowRecord buildRowRecord(long index)
Gets a row record from result. ThrowsParamExceptionif the index is illegal.- Returns:
RowRecorda row record of the result
-
getFieldDataList
protected List<FieldData> getFieldDataList()
- Specified by:
getFieldDataListin classRowRecordWrapper
-
getOutputFields
protected List<String> getOutputFields()
- Specified by:
getOutputFieldsin classRowRecordWrapper
-
getFieldData
public List<?> getFieldData(@NonNull @NonNull String fieldName, int indexOfTarget)
Gets data for an output field which is specified by search request. ThrowsParamExceptionif the field doesn't exist. ThrowsParamExceptionif the indexOfTarget is illegal.- Parameters:
fieldName- field name to get output dataindexOfTarget- which target vector the field data belongs to- Returns:
FieldDataWrapper
-
getIDScore
public List<SearchResultsWrapper.IDScore> getIDScore(int indexOfTarget) throws ParamException, IllegalResponseException
Gets ID-score pairs returned by search interface. ThrowsParamExceptionif the indexOfTarget is illegal. ThrowsIllegalResponseExceptionif 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:
ParamExceptionIllegalResponseException
-
-