highest possible value for elasticsearch max_terms_count

Viewed 468

I want to set index.max_terms_count setting to highest possible value for my index. How do it do that?

I couldn't find any documentation on the highest possible value for that setting.

1 Answers

The answer seems to be 2147483647.

I found it out by looking into elasticsearch source on github and then confirming it by making a PUT settings call on a test elasticsearch index.

  • Turns out the max_terms_count setting is implemented as a Java Integer (MAX_TERMS_COUNT_SETTING member in org.elasticsearch.index.IndexSettings).

  • The highest value for a Java Integer is 2147483647 (Integer.MAX_VALUE).

  • Quick evidence:

    • Using the PUT index setting API, I set the setting to 2147483647 and it was successful;
    • however, when I set it to 2147483648 it threw an exception elasticsearch.exceptions.RequestError: RequestError(400, 'illegal_argument_exception', 'Failed to parse value [2147483648] for setting [index.max_terms_count]').
Related