result = table.query(
"vector",
[[0.9, 0.5]],
["pk", "text", "vector", "number"],
3
)
Result:
This method returns a HippoResult list, and every HippoResult object contains the query result. If the error pops up when querying, “ValueError” or “RuntimeError” exception will be raised.
Parameter description:
Parameters | Description | Required |
---|---|---|
search_field (str) | Field to search on | Yes |
vectors (list[list[float]]) | Vector list to search on | Yes |
output_fields (list[str]) | Output field list | Yes |
topk (int) | Top k nearest neighbors to return | Yes |
metric_type (str) | Metric type used to measure distance | No, defaults to "l2" |
dsl (str) | DSL string used to perform complex SQL query | No |
params (dict) | Additional parameters | No |