Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions solutions/search/query-rules-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ applies_to:
stack: ga 9.1
serverless: ga
elasticsearch:
products:
- id: elasticsearch
---

# Query rules UI
Use query rules to boost, pin, or exclude specific documents when queries contain certain keywords, phrases, or match defined search patterns.
Use query rules to pin or exclude specific documents when queries contain certain keywords, phrases, or match defined search patterns.
The Query rules UI provides a graphical interface to manage these rules without writing API calls or JSON configuration.

The UI enables you to:

- Set keyword triggers and conditions for when rules apply
- Pin, boost, or exclude specific documents in results
- Set keyword or numerical conditions. For a full list of options, refer to [Rule criteria](elasticsearch://reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rule-criteria).
- Pin or exclude specific documents in results
- Organize rules into rulesets and set execution priority
- Test rules against sample queries before publishing

## UI vs. API: What's the difference?

The Query Rules UI provides the same functionality as the API with one key difference in how documents are pinned:
The Query Rules UI provides the same functionality as the API with one key difference:

* The UI defaults to `docs` for maximum flexibility, but still allows `id`-based pinning for single-index searches through a simplified form.
* The UI defaults to `docs` for creating and editing rules. You cannot edit an `id` based rule that was created through the API.

To see examples of how to search using query rules, refer [Search using Query Rules API](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/searching-with-query-rules).

Expand All @@ -31,12 +33,12 @@ If you prefer to use the Query Rules API, refer to [Query Rules API]({{es-apis}}
If you want to get full access to the Query Rules UI, you must have the following privileges:

* Appropriate roles to access Kibana. For more information, refer to [Built-in roles](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/built-in-roles) or [Kibana privileges](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/kibana-privileges)
* A custom role with `manage_search_query_rules` cluster privilege
* A role with `manage_search_query_rules` cluster privilege
* `ALL` option for `Query Rules` role privilege in the respective Kibana space

## Accessing the Query Rules UI

Go to your deployment and select **Query Rules** from the left navigation menu under **Relevance**. If you're not able to see the option, contact the administrator to review the role assigned to you.
Go to your deployment and select **Query Rules** from the left navigation menu under **Relevance**. If you're not able to see the option, contact your administrator to review the role assigned to you.

:::{image} /solutions/images/elasticsearch-query-rules-ui-home.png
:alt: Landing page for Query Rules UI.
Expand All @@ -54,13 +56,13 @@ Use the following steps to first create a query ruleset, and then a query rule:
- **Pin**: Pin selected documents to the top of the search results.
- **Exclude**: Exclude selected documents from the results.

For more information on rule types, refer [Rule types](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/searching-with-query-rules#query-rule-type).
For more information on rule types, refer to [Rule types](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/searching-with-query-rules#query-rule-type).
4. Select one or more documents for the rule to apply to.
5. Select one of the following rule criteria:
- **Always**: Apply the rule to all queries
- **Custom**: Define conditions when the rule is applied.

For a full list of options, refer [Rule criteria](elasticsearch://reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rule-criteria).
For a full list of options, refer to [Rule criteria](elasticsearch://reference/elasticsearch/rest-apis/searching-with-query-rules.md#query-rule-criteria).
6. Select **Create rule**.
7. Select **Save** in the top right corner of the ruleset section.

Expand Down Expand Up @@ -118,7 +120,7 @@ To test a query ruleset, do the following:

## Learn more

Following resources can help you understand query rules better:
The following resources can help you understand query rules better:

Blogs:

Expand Down
Loading