Skip to content

Commit 718849e

Browse files
authored
[Query Rules] Add some usability clarifications to docs (#102990) (#103090)
* [Query Rules] Add some usability clarifications to docs * Fix typo
1 parent cf3ea8a commit 718849e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/reference/query-dsl/rule-query.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ preview::[]
1010
Applies <<query-rules-apis,query rules>> to the query before returning results.
1111
This feature is used to promote documents in the manner of a <<query-dsl-pinned-query>> based on matching defined rules.
1212
If no matching query rules are defined, the "organic" matches for the query are returned.
13+
All matching rules are applied in the order in which they appear in the query ruleset.
1314

1415
[NOTE]
1516
====

docs/reference/query-rules/apis/put-query-ruleset.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ Requires the `manage_search_query_rules` privilege.
2929
`rules`::
3030
(Required, array of objects) The specific rules included in this query ruleset.
3131

32+
There is a limit of 100 rules per ruleset.
33+
This can be increased up to 1000 using the `xpack.applications.rules.max_rules_per_ruleset` cluster setting.
34+
3235
Each rule must have the following information:
3336

3437
- `rule_id` (Required, string) A unique identifier for this rule.

docs/reference/search/search-your-data/search-using-query-rules.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ PUT /_query_rules/my-ruleset
174174

175175
The API response returns a results of `created` or `updated` depending on whether this was a new or edited ruleset.
176176

177+
NOTE: There is a limit of 100 rules per ruleset.
178+
This can be increased up to 1000 using the `xpack.applications.rules.max_rules_per_ruleset` cluster setting.
179+
177180
[source,console-result]
178181
----
179182
{
@@ -217,3 +220,8 @@ GET /my-index-000001/_search
217220

218221
This rule query will match against `rule1` in the defined query ruleset, and will convert the organic query into a pinned query with `id1` and `id2` pinned as the top hits.
219222
Any other matches from the organic query will be returned below the pinned results.
223+
224+
It's possible to have multiple rules in a ruleset match a single `rule_query`. In this case, the pinned documents are returned in the following order:
225+
226+
- Where the matching rule appears in the ruleset
227+
- If multiple documents are specified in a single rule, in the order they are specified

0 commit comments

Comments
 (0)