From 68bc695fd678adbc6f9fe5bb3fbc65b1e1d2f14d Mon Sep 17 00:00:00 2001 From: abid-redis Date: Sun, 9 Nov 2025 22:12:03 +0530 Subject: [PATCH] docs: separate query attributes from query syntax page --- .../advanced-concepts/query_attributes.md | 22 ++++++++++++++++++ .../advanced-concepts/query_syntax.md | 23 ------------------- 2 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 content/develop/ai/search-and-query/advanced-concepts/query_attributes.md diff --git a/content/develop/ai/search-and-query/advanced-concepts/query_attributes.md b/content/develop/ai/search-and-query/advanced-concepts/query_attributes.md new file mode 100644 index 0000000000..93e6ebc435 --- /dev/null +++ b/content/develop/ai/search-and-query/advanced-concepts/query_attributes.md @@ -0,0 +1,22 @@ +## Query attributes + +As of v1.2.0, you can apply specific query modifying attributes to specific clauses of the query. + +The syntax is `(foo bar) => { $attribute: value; $attribute:value; ...}`: + +``` +(foo bar) => { $weight: 2.0; $slop: 1; $inorder: true; } +~(bar baz) => { $weight: 0.5; } +``` + +The supported attributes are: + +1. **$weight**: determines the weight of the sub-query or token in the overall ranking on the result (default: 1.0). +2. **$slop**: determines the maximum allowed slop (space between terms) in the query clause (default: 0). +3. **$inorder**: whether or not the terms in a query clause must appear in the same order as in the query. This is usually set alongside with `$slop` (default: false). +4. **$phonetic**: whether or not to perform phonetic matching (default: true). Note: setting this attribute to true for fields which were not created as `PHONETIC` will produce an error. + +As of v2.6.1, the query attributes syntax supports these additional attributes: + +* **$yield_distance_as**: specifies the distance field name, used for later sorting and/or returning, for clauses that yield some distance metric. It is currently supported for vector queries only (both KNN and range). +* **vector query params**: pass optional parameters for [vector queries]({{< relref "develop/ai/search-and-query/vectors#querying-vector-fields" >}}) in key-value format. diff --git a/content/develop/ai/search-and-query/advanced-concepts/query_syntax.md b/content/develop/ai/search-and-query/advanced-concepts/query_syntax.md index 17189011f7..9fea6b3e8e 100644 --- a/content/develop/ai/search-and-query/advanced-concepts/query_syntax.md +++ b/content/develop/ai/search-and-query/advanced-concepts/query_syntax.md @@ -369,29 +369,6 @@ As of v1.1.0, you can use a special query to retrieve all the documents in an in You can't combine this with any other filters, field modifiers, or anything inside the query. It is technically possible to use the deprecated `FILTER` and `GEOFILTER` request parameters outside the query string in conjunction with a wildcard, but this makes the wildcard meaningless and only hurts performance. -## Query attributes - -As of v1.2.0, you can apply specific query modifying attributes to specific clauses of the query. - -The syntax is `(foo bar) => { $attribute: value; $attribute:value; ...}`: - -``` -(foo bar) => { $weight: 2.0; $slop: 1; $inorder: true; } -~(bar baz) => { $weight: 0.5; } -``` - -The supported attributes are: - -1. **$weight**: determines the weight of the sub-query or token in the overall ranking on the result (default: 1.0). -2. **$slop**: determines the maximum allowed slop (space between terms) in the query clause (default: 0). -3. **$inorder**: whether or not the terms in a query clause must appear in the same order as in the query. This is usually set alongside with `$slop` (default: false). -4. **$phonetic**: whether or not to perform phonetic matching (default: true). Note: setting this attribute to true for fields which were not created as `PHONETIC` will produce an error. - -As of v2.6.1, the query attributes syntax supports these additional attributes: - -* **$yield_distance_as**: specifies the distance field name, used for later sorting and/or returning, for clauses that yield some distance metric. It is currently supported for vector queries only (both KNN and range). -* **vector query params**: pass optional parameters for [vector queries]({{< relref "develop/ai/search-and-query/vectors#querying-vector-fields" >}}) in key-value format. - ## A few query examples * Simple phrase query - `hello` _AND_ `world`: