What is the maximum query length in the request body for the rest API of elasticsearch

(Jingyan) #1

I want to use query DSL to query data against elasticsearch, the request like following:
GET /index_test/_search

For the testId filed, I will using a long items to match . So I need to add a lot of values in the terms.
like this:

So I want to know how many values I can add for the values of testId.
And so I need to know how long the query length in the request body?

(Christian Dahlqvist) #2

There is no fixed limit. Elasticsearch will accept request bodies up to several MB in size by default. As seem in this thread, large terms queries are likely to get slow as the list of terms grows though. You will need to benchmark to see exactly how many you can handle with acceptable query latencies.

(system) #3

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