Last active
June 21, 2022 17:57
-
-
Save generall/383c01994a672424ff59f5fa56cd0c4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qdrant_client.http.models import Filter | |
... | |
city_of_interest = "Berlin" | |
# Define a filter for cities | |
city_filter = Filter(**{ | |
"must": [{ | |
"key": "city", # We store city information in a field of the same name | |
"match": { # This condition checks if payload field have requested value | |
"value": city_of_interest | |
} | |
}] | |
}) | |
search_result = self.qdrant_client.search( | |
collection_name=self.collection_name, | |
query_vector=vector, | |
query_filter=city_filter, | |
top=5 | |
) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment