From 1bd937aa5b67903ebf8b01bc6dd2f965d1b56149 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 18 Nov 2025 13:12:07 +0100 Subject: [PATCH] Refactor query structure in qdrant-1.16.x.md Updated the query structure to use a predefined QUERY object for consistency and clarity. --- qdrant-landing/content/blog/qdrant-1.16.x.md | 39 ++++++++------------ 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/qdrant-landing/content/blog/qdrant-1.16.x.md b/qdrant-landing/content/blog/qdrant-1.16.x.md index c42f6b879..8470411e5 100644 --- a/qdrant-landing/content/blog/qdrant-1.16.x.md +++ b/qdrant-landing/content/blog/qdrant-1.16.x.md @@ -162,41 +162,34 @@ The `text_any` condition matches text fields that contain any of the query terms A good example of using the `text_any` condition is in e-commerce applications, where users often search for products using multiple keywords. By combining a vector query with a series of increasingly lenient full-text filters, you can ensure that users receive relevant results even if their initial search terms are too restrictive. -```json -batch [ +```python +QUERY = { + "text": "best smartphone ever", + "model": "sentence-transformers/all-MiniLM-L6-v2" +} + +batch_query = [ { - "query": { - "text": "best smartphone ever", - "model": "sentence-transformers/all-MiniLM-L6-v2" - }, + "query": QUERY, "filter": { "must": { "key": "description", - "match": { - "text": "5G 5000mAh OLED" - } + "match": { "text": "5G 5000mAh OLED" } } } }, - { - "query": { - "text": "best smartphone ever", - "model": "sentence-transformers/all-MiniLM-L6-v2" - }, + { # fallback to at least one token + "query": QUERY, "filter": { "must": { "key": "description", - "match": { - "text_any": "5G 5000mAh OLED" - } + "match": { "text_any": "5G 5000mAh OLED" } } } }, - { - "query": { - "text": "best smartphone ever", - "model": "sentence-transformers/all-MiniLM-L6-v2" - } + { # fallback to just similarity + "query": QUERY, + "filter": null } ] ``` @@ -273,4 +266,4 @@ We recommend upgrading versions one by one, for example, 1.14->1.15->1.16. ![Engage](/blog/qdrant-1.16.x/section-9.png) -We would love to hear your thoughts on this release. If you have any questions or feedback, join our [Discord](https://discord.gg/qdrant) or create an issue on [GitHub](https://github.com/qdrant/qdrant/issues). \ No newline at end of file +We would love to hear your thoughts on this release. If you have any questions or feedback, join our [Discord](https://discord.gg/qdrant) or create an issue on [GitHub](https://github.com/qdrant/qdrant/issues).