milvus-io/milvus-sdk-java

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

Opened this issue · 1 comments

throw new ParamException("Illegal field name: " + fieldName);

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.

yhmo commented

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)