milvus-sdk-java
milvus-sdk-java copied to clipboard
SearchResultsWrapper#getFieldData throws ParamException when a search has no matching records
https://github.com/milvus-io/milvus-sdk-java/blob/9c3adb7dd500ef5ba5709a7d787ead55a09fb7e8/src/main/java/io/milvus/response/SearchResultsWrapper.java#L41
Users would expect getFieldData
on a valid filedName
to return an empty list even if a search has no matching records.
However, it throws a ParamException
with Illegal field name
instead, because SearchResultData#fieldsData_ seems to be empty when a search has no matching records.
The getFieldData() returns a List<?>, if we don't throw an exception, we don't know which type should be returned in the List.
List<?> getFieldData(@NonNull String fieldName, int indexOfTarget)