Package io.milvus.response
Class FieldDataWrapper
java.lang.Object
io.milvus.response.FieldDataWrapper
Utility class to wrap response of
query/search interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a field's value by field name.getAsDouble(int index, String paramName) getAsString(int index, String paramName) intgetDim()Gets the dimension value of a vector field.List<?> Returns the field data according to its type: FloatVector field returns List of List Float, BinaryVector/Float16Vector/BFloat16Vector fields return List of ByteBuffer SparseFloatVector field returns List of SortedMap[Long, Float] Int64 field returns List of Long Int32/Int16/Int8 fields return List of Integer Bool field returns List of Boolean Float field returns List of Float Double field returns List of Double Varchar field returns List of String Array field returns List of List JSON field returns List of String; etc.longGets the row count of a field.booleanbooleanbooleanstatic com.google.gson.JsonElementParseJSONObject(Object object) valueByIdx(int index) static ObjectValueOfJSONElement(com.google.gson.JsonElement element)
-
Constructor Details
-
FieldDataWrapper
-
-
Method Details
-
isVectorField
public boolean isVectorField() -
isJsonField
public boolean isJsonField() -
isDynamicField
public boolean isDynamicField() -
getDim
Gets the dimension value of a vector field. ThrowIllegalResponseExceptionif the field is not a vector filed.- Returns:
intdimension of the vector field- Throws:
IllegalResponseException
-
getRowCount
Gets the row count of a field. * ThrowsIllegalResponseExceptionif the field type is illegal.- Returns:
longrow count of the field- Throws:
IllegalResponseException
-
getFieldData
Returns the field data according to its type: FloatVector field returns List of List Float, BinaryVector/Float16Vector/BFloat16Vector fields return List of ByteBuffer SparseFloatVector field returns List of SortedMap[Long, Float] Int64 field returns List of Long Int32/Int16/Int8 fields return List of Integer Bool field returns List of Boolean Float field returns List of Float Double field returns List of Double Varchar field returns List of String Array field returns List of List JSON field returns List of String; etc. ThrowsIllegalResponseExceptionif the field type is illegal.- Returns:
List- Throws:
IllegalResponseException
-
getAsInt
- Throws:
IllegalResponseException
-
getAsString
- Throws:
IllegalResponseException
-
getAsBool
- Throws:
IllegalResponseException
-
getAsDouble
- Throws:
IllegalResponseException
-
get
Gets a field's value by field name.- Parameters:
index- which rowparamName- which field- Returns:
- returns Long for integer value, returns Double for decimal value, returns String for string value, returns JsonElement for JSON object and Array.
- Throws:
IllegalResponseException
-
valueByIdx
- Throws:
ParamException
-
ParseJSONObject
-
ValueOfJSONElement
-