List query rulesets

edit

This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Returns information about all stored query rulesets. Summary information on the number of rules per ruleset will be returned, and full details can be returned with the Get query ruleset command.

Request

edit

GET _query_rules/

Prerequisites

edit

Requires the manage_search_query_rules privilege.

Path parameters

edit
size
(Optional, integer) Maximum number of results to retrieve.
from
(Optional, integer) The offset from the first result to fetch.

Examples

edit

The following example lists all configured query rulesets:

GET _query_rules/

The following example lists the first three query rulesets:

GET _query_rules/?from=0&size=3

A sample response:

{
    "count": 3,
    "results": [
        {
            "ruleset_id": "ruleset-1",
            "rule_total_count": 1,
            "rule_criteria_types_counts": {
                "exact": 1
            }
        },
        {
            "ruleset_id": "ruleset-2",
            "rule_total_count": 2,
            "rule_criteria_types_counts": {
                "exact": 1,
                "fuzzy": 1
            }
        },
        {
            "ruleset_id": "ruleset-3",
            "rule_total_count": 3,
            "rule_criteria_types_counts": {
                "exact": 1,
                "fuzzy": 2
            }
        }
    ]
}

The counts in rule_criteria_types_counts may be larger than the value of rule_total_count, because a rule may have multiple criteria.