Milvex.QueryResult
(milvex v0.6.0)
Copy Markdown
Parser for Milvus query results.
Converts the columnar FieldData format from Milvus QueryResults into row-oriented Elixir maps for easy consumption.
Examples
# Parse from proto
{:ok, result} = QueryResult.from_proto(query_results)
# Access results
result.rows # List of row maps
result.collection_name # Collection queried
result.output_fields # Field names returned
# Each row is a map
row = hd(result.rows)
row.id # Primary key value
row.title # Field value
Summary
Functions
Checks if the result is empty.
Parses a QueryResults proto into a QueryResult struct.
Gets all values for a specific field across all rows.
Gets a specific row by index (0-based).
Returns the number of rows in the result.
Types
Functions
Checks if the result is empty.
@spec from_proto(Milvex.Milvus.Proto.Milvus.QueryResults.t()) :: t()
Parses a QueryResults proto into a QueryResult struct.
Converts columnar FieldData to row-oriented maps.
Parameters
proto- The QueryResults protobuf struct
Gets all values for a specific field across all rows.
@spec get_row(t(), non_neg_integer()) :: map() | nil
Gets a specific row by index (0-based).
@spec num_rows(t()) :: non_neg_integer()
Returns the number of rows in the result.