Vector Similarity Search

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:

ParametersDescriptionRequired
search_field (str)Field to search onYes
vectors (list[list[float]])Vector list to search onYes
output_fields (list[str])Output field listYes
topk (int)Top k nearest neighbors to returnYes
metric_type (str)Metric type used to measure distanceNo, defaults to "l2"
dsl (str)DSL string used to perform complex SQL queryNo
params (dict)Additional parametersNo
Table 82 Vector Similarity Search (Python API)