Skip to content

Instantly share code, notes, and snippets.

@kacperlukawski
Created September 26, 2022 14:18
Show Gist options
  • Save kacperlukawski/c3776a82bc500ac81a866808f451d0b0 to your computer and use it in GitHub Desktop.
Save kacperlukawski/c3776a82bc500ac81a866808f451d0b0 to your computer and use it in GitHub Desktop.
results = client.search_batch(
collection_name="test_collection",
requests=[
SearchRequest(
vector=[0., 0., 2., 0.],
limit=1,
),
SearchRequest(
vector=[0., 0., 0., 0.01],
with_vector=True,
limit=2,
)
]
)
# Out: [
# [ScoredPoint(id=2, version=0, score=1.9,
# payload=None, vector=None)],
# [ScoredPoint(id=3, version=0, score=0.09,
# payload=None, vector=[0.0, 0.0, 0.0, 0.1]),
# ScoredPoint(id=1, version=0, score=0.10049876,
# payload=None, vector=[0.0, 0.1, 0.0, 0.0])]
# ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment