![JAR search and dependency download from the Maven repository](/logo.png)
io.milvus.response.QueryResultsWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of milvus-sdk-java Show documentation
Show all versions of milvus-sdk-java Show documentation
Java SDK for Milvus, a distributed high-performance vector search engine.
update grpc to 1.42.1
update protobuf to 3.19.1
restore the calcDistance interface that is removed in 2.1.0-beta4
package io.milvus.response;
import io.milvus.exception.ParamException;
import io.milvus.grpc.*;
import lombok.NonNull;
import java.util.List;
/**
* Utility class to wrap response of query
interface.
*/
public class QueryResultsWrapper {
private final QueryResults results;
public QueryResultsWrapper(@NonNull QueryResults results) {
this.results = results;
}
/**
* Gets {@link FieldDataWrapper} for a field.
* Throws {@link ParamException} if the field doesn't exist.
*
* @param fieldName field name to get output data
* @return {@link FieldDataWrapper}
*/
public FieldDataWrapper getFieldWrapper(@NonNull String fieldName) throws ParamException {
List fields = results.getFieldsDataList();
for (FieldData field : fields) {
if (fieldName.compareTo(field.getFieldName()) == 0) {
return new FieldDataWrapper(field);
}
}
throw new ParamException("The field name doesn't exist");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy