docs: Query API snippets with Python (#1095)

Co-authored-by: generall <andrey@vasnetsov.com>
This commit is contained in:
Anush
2024-08-23 22:48:27 +05:30
committed by GitHub
co-authored by generall
parent 4821e18664
commit e9fa9be0a4
17 changed files with 203 additions and 195 deletions
@@ -300,9 +300,9 @@ status: Completed
Let's ask a basic question - Which of our stored vectors are most similar to the query vector `[0.2, 0.1, 0.9, 0.7]`?
```python
search_result = client.search(
collection_name="test_collection", query_vector=[0.2, 0.1, 0.9, 0.7], limit=3
)
search_result = client.query_points(
collection_name="test_collection", query=[0.2, 0.1, 0.9, 0.7], limit=3
).points
print(search_result)
```
@@ -399,15 +399,15 @@ We can narrow down the results further by filtering by payload. Let's find the c
```python
from qdrant_client.models import Filter, FieldCondition, MatchValue
search_result = client.search(
search_result = client.query_points(
collection_name="test_collection",
query_vector=[0.2, 0.1, 0.9, 0.7],
query=[0.2, 0.1, 0.9, 0.7],
query_filter=Filter(
must=[FieldCondition(key="city", match=MatchValue(value="London"))]
),
with_payload=True,
limit=3,
)
).points
print(search_result)
```