mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-06 11:28:31 +02:00
Refactor query structure in qdrant-1.16.x.md
Updated the query structure to use a predefined QUERY object for consistency and clarity.
This commit is contained in:
@@ -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.
|
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
|
```python
|
||||||
batch [
|
QUERY = {
|
||||||
|
"text": "best smartphone ever",
|
||||||
|
"model": "sentence-transformers/all-MiniLM-L6-v2"
|
||||||
|
}
|
||||||
|
|
||||||
|
batch_query = [
|
||||||
{
|
{
|
||||||
"query": {
|
"query": QUERY,
|
||||||
"text": "best smartphone ever",
|
|
||||||
"model": "sentence-transformers/all-MiniLM-L6-v2"
|
|
||||||
},
|
|
||||||
"filter": {
|
"filter": {
|
||||||
"must": {
|
"must": {
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"match": {
|
"match": { "text": "5G 5000mAh OLED" }
|
||||||
"text": "5G 5000mAh OLED"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{ # fallback to at least one token
|
||||||
"query": {
|
"query": QUERY,
|
||||||
"text": "best smartphone ever",
|
|
||||||
"model": "sentence-transformers/all-MiniLM-L6-v2"
|
|
||||||
},
|
|
||||||
"filter": {
|
"filter": {
|
||||||
"must": {
|
"must": {
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"match": {
|
"match": { "text_any": "5G 5000mAh OLED" }
|
||||||
"text_any": "5G 5000mAh OLED"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{ # fallback to just similarity
|
||||||
"query": {
|
"query": QUERY,
|
||||||
"text": "best smartphone ever",
|
"filter": null
|
||||||
"model": "sentence-transformers/all-MiniLM-L6-v2"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
@@ -273,4 +266,4 @@ We recommend upgrading versions one by one, for example, 1.14->1.15->1.16.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|||||||
Reference in New Issue
Block a user