<p dir="auto">Have this exception during indexation documents for suggest completion:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    suggest_top_products:
        client: default
        index_name: my_index_suggest_top_products
        use_alias: true
        settings:
            number_of_shards:   6
            number_of_replicas: 0
            index:
                analysis:
                    analyzer:
                        completion:
                            type: custom
                            tokenizer: whitespace
                            filter: [short_word_delimiter, lowercase, asciifolding, apostrophe, op_synonyms, snow_english]
                            char_filter: html_strip

                    filter:
                        snow_english:
                            type: snowball
                            language: English

                        short_word_delimiter:
                            type: word_delimiter
                            generate_word_parts: true
                            generate_number_parts: true
                            catenate_words: true
                            catenate_numbers: true
                            catenate_all: true
                            split_on_case_change: true
                            preserve_original: true

                        op_synonyms:
                            type: synonym
                            ignore_case: true
                            expand: true
                            synonyms:
                              - &quot;riflescopes, rifle scopes&quot;
                              - &quot;riflescope, rifle scope&quot;

        types:
            auto_suggest:
                mappings:
                    text: {type: string, index: not_analyzed}
                    top_products:
                        type: completion
                        index_analyzer: completion
                        search_analyzer: completion
                        payloads: true
                        preserve_position_increments: false
                        preserve_separators: false"><pre class="notranslate"><code class="notranslate">    suggest_top_products:
        client: default
        index_name: my_index_suggest_top_products
        use_alias: true
        settings:
            number_of_shards:   6
            number_of_replicas: 0
            index:
                analysis:
                    analyzer:
                        completion:
                            type: custom
                            tokenizer: whitespace
                            filter: [short_word_delimiter, lowercase, asciifolding, apostrophe, op_synonyms, snow_english]
                            char_filter: html_strip

                    filter:
                        snow_english:
                            type: snowball
                            language: English

                        short_word_delimiter:
                            type: word_delimiter
                            generate_word_parts: true
                            generate_number_parts: true
                            catenate_words: true
                            catenate_numbers: true
                            catenate_all: true
                            split_on_case_change: true
                            preserve_original: true

                        op_synonyms:
                            type: synonym
                            ignore_case: true
                            expand: true
                            synonyms:
                              - "riflescopes, rifle scopes"
                              - "riflescope, rifle scope"

        types:
            auto_suggest:
                mappings:
                    text: {type: string, index: not_analyzed}
                    top_products:
                        type: completion
                        index_analyzer: completion
                        search_analyzer: completion
                        payloads: true
                        preserve_position_increments: false
                        preserve_separators: false
</code></pre></div>
<p dir="auto">Document is:<br>
{"text":"Sure-Fire Z59 Click-On Lock-Out Tailcap for C2 / C3 / D2 / D3 / G3 / M2 / M3 / M3T / M4 Flashlights","top_products":{"input":["Sure-Fire Z59 Click-On Lock-Out Tailcap for C2 C3 D2 D3 G3 M2 M3 M3T M4 Flashlights","C2 C3 D2 D3 G3 M2 M3 M3T M4 Flashlights"],"output":"Sure-Fire Z59 Click-On Lock-Out Tailcap for C2 / C3 / D2 / D3 / G3 / M2 / M3 / M3T / M4 Flashlights","weight":"144","payload":{"type":"top_product","product_id":"32378","weight":"144","primary_image":"opplanet-surefire-tailcaps-switches-z59","rating":"0.00","review_count":"0","url":"surefire-tailcaps-switches-z59"}}}</p>
<p dir="auto">I use the context suggester for, well, suggestions, and I have more than 256 different categories.</p>
<p dir="auto">When I try to index a document with 257 categories, I get the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
   &quot;error&quot;:&quot;IllegalArgumentException[TokenStream expanded to 257 finite strings. Only &lt;= 256 finite strings are supported]&quot;,
   &quot;status&quot;:500
}"><pre class="notranslate"><code class="notranslate">{
   "error":"IllegalArgumentException[TokenStream expanded to 257 finite strings. Only &lt;= 256 finite strings are supported]",
   "status":500
}
</code></pre></div>
<p dir="auto">I have uploaded a simple curl example here: <a href="https://gist.github.com/goldmar/2c3f64575df420a5413a">https://gist.github.com/goldmar/2c3f64575df420a5413a</a></p>