# Completion suggester - Finite Strings Error

**URL:** https://discuss.elastic.co/t/completion-suggester-finite-strings-error/23156
**Category:** Elasticsearch
**Created:** [April 8, 2015, 7:57pm UTC](https://discuss.elastic.co/t/completion-suggester-finite-strings-error/23156 "2015-04-08T19:57:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ap1](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Ap1](https://discuss.elastic.co/u/Ap1)
#### Post date: [April 8, 2015, 7:57pm UTC](https://discuss.elastic.co/t/completion-suggester-finite-strings-error/23156/1 "2015-04-08T19:57:09Z")

</div>

I get the following error when I try to insert a doc

_TransportError(500, u'IllegalArgumentException[TokenStream expanded to  
44800 finite strings. Only \<= 256 finite strings are supported]')_

_Index: This gets created successfully_

```
    index_body = {
        "settings": {
            "analysis": {
                "filter": {
                    "nGram_filter": {
                        "type": "edge_ngram",
                        "min_gram": 2,
                        "max_gram": 20,
                        "token_chars": [
                            "letter",
                            "digit",
                            "punctuation",
                            "symbol"
                        ]
                    }
                },
                "analyzer": {
                    "nGram_analyzer": {
                        "type": "custom",
                        "tokenizer": "whitespace",
                        "filter": [
                            "lowercase",
                            "asciifolding",
                            "nGram_filter"
                        ]
                    },
                    "whitespace_analyzer": {
                        "type": "custom",
                        "tokenizer": "whitespace",
                        "filter": [
                            "lowercase",
                            "asciifolding"
                        ]
                    },
                    "folding": {
                        "tokenizer": "standard",
                        "filter": [
                            "lowercase",
                            "asciifolding"
                        ]
                    }
                }
            }
        },
        "mappings": {
            "funds" : {
                    "name": {
                        "type": "string",
                        "index": "not_analyzed"
                    },
                    "suggest" : {
                        "type" : "completion",
                        "index_analyzer" : "nGram_analyzer",
                        "search_analyzer" : "whitespace_analyzer",
                        "payloads" : "true"
                    }
                }
            }
        }
    }

```

\*Doc to insert: \*

\*This gets inserted fine \*  
json3 = {  
"name" : "ABC 123144",  
"suggest" : {  
"input": ["ABC 123144"],  
"output": "ABC 123144",  
"payload" : {  
"id" : "ID123"  
}  
}  
}

_This doc gives the above error_

- json2 = {\*
- 

```
   "name" : "ABC 123144 ASDASD ASFSDFADF GROUP ADSAD ADAFAFAF",*

```

- 

```
   "suggest" : {*

```

- 

```
       "input": ["ABC 123144 ASDASD ASFSDFADF GROUP ADSAD ADAFAFAF"],*

```

- 

```
       "output": "ABC 123144 ASDASD ASFSDFADF GROUP ADSAD ADAFAFAF",*

```

- 

```
       "payload" : {*

```

- 

```
           "id" : "ID123"*

```

- 

```
       }*

```

- 

```
   }*

```

- }\*

What are the possible solutions or alternatives for this error ?

Thanks

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6d8f5d86-ef8c-4f10-9e71-7eeae363837d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6d8f5d86-ef8c-4f10-9e71-7eeae363837d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:20am UTC](https://discuss.elastic.co/t/completion-suggester-finite-strings-error/23156/2 "2017-07-06T00:20:48Z")

</div>


