milvus-sdk-java icon indicating copy to clipboard operation
milvus-sdk-java copied to clipboard

SearchResultsWrapper#getFieldData throws ParamException when a search has no matching records

Open zero11-0203 opened this issue 1 year ago • 1 comments

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.

zero11-0203 avatar Jul 19 '23 07:07 zero11-0203

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)

yhmo avatar Aug 04 '23 07:08 yhmo