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 of `search` interface.

### Nested Class Summary

Nested Classes
`static class` `SearchResultsWrapper.IDScore` Internal-use class to wrap response of `search` interface.

### Constructor Summary

Constructors
Constructor and Description
`SearchResultsWrapper(@NonNull io.milvus.grpc.SearchResultData results)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`java.util.List<?>` `getFieldData(@NonNull java.lang.String fieldName, int indexOfTarget)` Gets data for an output field which is specified by search request.
`FieldDataWrapper` `getFieldWrapper(@NonNull java.lang.String fieldName)` Gets `FieldDataWrapper` for a field.
`java.util.List<SearchResultsWrapper.IDScore>` `getIDScore(int indexOfTarget)` Gets ID-score pairs returned by search interface.
`java.util.List<QueryResultsWrapper.RowRecord>` `getRowRecords()` Deprecated.
`java.util.List<QueryResultsWrapper.RowRecord>` `getRowRecords(int indexOfTarget)` Note: this method's function is duplicated with getIDScore(), it is for high-level search.

### Methods inherited from class io.milvus.response.basic.RowRecordWrapper

`getDynamicWrapper`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SearchResultsWrapper

    public SearchResultsWrapper(@NonNull
                                @NonNull io.milvus.grpc.SearchResultData results)

### Method Detail

#### getFieldWrapper

    public FieldDataWrapper getFieldWrapper(@NonNull
                                            @NonNull java.lang.String fieldName)
                                     throws ParamException

Gets `FieldDataWrapper` for a field. Throws `ParamException` if the field doesn't exist.

Parameters:
  `fieldName` - field name to get output data
Returns:
  `FieldDataWrapper`
Throws:
  `ParamException`

#### getRowRecords

    @Deprecated
    public java.util.List<QueryResultsWrapper.RowRecord> getRowRecords()

Deprecated.
Note: this method only can return the first target vector's topk result and its function is duplicated with getIDScore(), so we mark it as deprecated.

Specified by:
  `getRowRecords` in class `RowRecordWrapper`

#### getRowRecords

    public java.util.List<QueryResultsWrapper.RowRecord> getRowRecords(int indexOfTarget)

Note: this method's function is duplicated with getIDScore(), it is for high-level search.

Parameters:
  `indexOfTarget` - index of a row
Returns:
  List of `QueryResultsWrapper.RowRecord`

#### 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. Throws `ParamException` if the field doesn't exist. Throws `ParamException` if the indexOfTarget is illegal.

Parameters:
  `fieldName` - field name to get output data
  `indexOfTarget` - 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. Throws `ParamException` if the indexOfTarget is illegal. Throws `IllegalResponseException` 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`