﻿---
title: Expensive queries disabled
description: Describes what AutoOps detects and surfaces with the Expensive queries disabled insight: `search.allow_expensive_queries` is false, so expensive query types cannot run.
url: https://docs-v3-preview.elastic.dev/elastic/autoops-insights/tree/main/elasticsearch/expensive_queries_disabled
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud Hosted
  - Elastic Cloud on Kubernetes
  - Elasticsearch
applies_to:
  - Elastic Cloud Hosted: Generally available
  - Elastic Cloud on Kubernetes: Generally available
  - Elastic Cloud Enterprise: Generally available
  - Self-managed Elastic deployments: Generally available
---

# Expensive queries disabled
`search.allow_expensive_queries` is false, so expensive query types cannot run. That can protect CPU and heap, and it can break Kibana and Fleet features that need those queries.
<note>
  For a complete list of insights, refer to [AutoOps insights](https://docs-v3-preview.elastic.dev/elastic/autoops-insights/tree/main/elasticsearch).
</note>


## Insight details


| Field     | Value                              |
|-----------|------------------------------------|
| Component | Elasticsearch                      |
| Severity  | Medium                             |
| Scope     | Cluster                            |
| Domains   | performance, search, configuration |


## Example: What you might see in AutoOps

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

### Expensive queries are turned off


#### What was detected

`search.allow_expensive_queries` is false. Expensive query types cannot run (for example fuzzy, regexp, prefix, wildcard, script, and percolate).

#### Recommendations

<note>
  AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.
</note>

<dropdown title="Re-enable expensive queries">
  **Condition**: Always shown for this insight.Set `search.allow_expensive_queries` to `true` unless this cluster does not use Kibana or Fleet and you are blocking expensive query types on purpose. False can break alerting, dashboards, saved-object search, and Fleet setup. Use the action below.
  ```json

  {
    "persistent": {
      "search.allow_expensive_queries": "true"
    }
  }
  ```

  <note>
    Requires the `manage cluster` privilege. Requires Elasticsearch 8.0.0 or later. This action changes cluster or index configuration.
  </note>
</dropdown>


#### Background and impact

Elasticsearch treats some Query DSL features as expensive because they can use large amounts of CPU and memory and slow other search and indexing on the same nodes.
The default is true so those query types can run. Kibana (alerting, dashboards, saved objects) and Fleet can fail when the setting is false.
If you turned it off to lock down a cluster that does not use Kibana or Fleet, the restriction might be intentional. On a typical Stack deployment, false is usually an unsafe override of the default.

## Guide

[Elastic Support Hub](https://support.elastic.co/knowledge/0cf1e1d9)