# What is "Query Length"?

**URL:** https://discuss.elastic.co/t/what-is-query-length/307835
**Category:** Elasticsearch
**Created:** [June 22, 2022, 5:59am UTC](https://discuss.elastic.co/t/what-is-query-length/307835 "2022-06-22T05:59:59Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 22, 2022, 5:59am UTC](https://discuss.elastic.co/t/what-is-query-length/307835/1 "2022-06-22T05:59:59Z")

</div>

Hi all, I'm wondering what query length is referring to in this limit guide (it is set to 128)? [Limits | Elastic App Search Documentation [8.2] | Elastic](https://www.elastic.co/guide/en/app-search/current/limits.html)

I am having a hard time understanding what part of the query is limited to 128. We are running Elasticsearch 7.9 (not 7.1 as I wrote earlier), is there any guidance as to what the default value for query length limit for version 7.9?

I'm running a search query in this format and it's succeeding despite some of these product id's being longer than 128 characters:

```auto
curl -X POST http://localhost:8080/index/_search -H "Content-Type: application/json" -d '{
  "query": {
    "bool" : {
        "filter" : {
          "term": {
            "category": "clothing"
          }, 
        }, 
        "filter" : {
            "terms" : { 
                "product_id" :[
                  "9de53bbf-2a65-49a1-8257-46029089804a"... (1000 of these)
               ]}}}}
                 

```

Thanks in advance

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 22, 2022, 6:00am UTC](https://discuss.elastic.co/t/what-is-query-length/307835/2 "2022-06-22T06:00:00Z")

</div>

Elasticsearch 7.1 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [June 22, 2022, 1:44pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/3 "2022-06-22T13:44:11Z")

</div>

Can you give more details about the query and the exception?

---

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 22, 2022, 5:54pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/4 "2022-06-22T17:54:07Z")

</div>

Thanks. I don't have an exception but the query is essentially "get me all things that 1. have clothing as their category 2. whose id is in this list of 1000 ids". I hoped that I captured this in the code snippet above.

My question is just what is "query length" in the limits page. I wasn't sure what that configuration refers to, thanks.

---

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 22, 2022, 6:02pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/5 "2022-06-22T18:02:10Z")

</div>

Also we are running 7.9 and not 7.1.

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [June 22, 2022, 8:33pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/6 "2022-06-22T20:33:50Z")

</div>

Maybe this doc about [Search Settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html)  
If you user Terms Query, read [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html#terms-top-level-params).

---

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 22, 2022, 9:22pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/7 "2022-06-22T21:22:42Z")

</div>

Many many thanks!

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 22, 2022, 10:53pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/8 "2022-06-22T22:53:09Z")

</div>

> [@minzeycat](#):
>
> Also we are running 7.9 and not 7.1.

7.9 is still [EOL](https://www.elastic.co/support/eol), you should be looking to upgrade ASAP.

---

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 23, 2022, 4:17pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/9 "2022-06-23T16:17:38Z")

</div>

Yup thanks!

---

<div class="post-metadata">

### Author: ![minzeycat](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@minzeycat](https://discuss.elastic.co/u/minzeycat)
#### Post date: [June 23, 2022, 4:18pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/10 "2022-06-23T16:18:22Z")

</div>

To close the gap, it turns out I'm not using App Search so this question is not applicable to my use case.

I am guessing query length makes more sense if you're an app search user and it's very clear what that means?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 21, 2022, 4:18pm UTC](https://discuss.elastic.co/t/what-is-query-length/307835/11 "2022-07-21T16:18:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
