# Autocomplete in Mapping does not work - MappingParsingException?

**URL:** <https://discuss.elastic.co/t/autocomplete-in-mapping-does-not-work-mappingparsingexception/12837>\
**Category:** Elasticsearch\
**Created:** [July 18, 2013, 9:13am UTC](https://discuss.elastic.co/t/autocomplete-in-mapping-does-not-work-mappingparsingexception/12837 "2013-07-18T09:13:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ES\_User](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@ES\_User](https://discuss.elastic.co/u/ES_User)\
**Post date:** [July 18, 2013, 9:13am UTC](https://discuss.elastic.co/t/autocomplete-in-mapping-does-not-work-mappingparsingexception/12837/1 "2013-07-18T09:13:05Z")

</div>

Hi!

I'm working with elasticsearch 0.90. and searching for a way to  
autocomplete some indexfields, when a user is typing some characters in the  
searchfield. In my mapping-template  
i have defined the analyzer and set it in the indexfield.

What am i doing wrong? The example for the autocomplete is from a blog and  
the elasticsearch-book, i'm a little bit frustrated that it doesn't work ☹

Thanks!!!

- 

First example: \*  
when i try this and want to setup a new index on the cluster, i get the  
following exception:  
_"MapperParsingException: Analyzer [autocomplete] not found for field  
[autocomplete]"_

{  
"default\_template" : {  
"template" : "\*",  
"settings" : {  
"index": {  
"number\_of\_shards": 2,  
"number\_of\_replicas": 0  
},  
"analysis" : {  
"analyzer" : {  
"autocomplete" : { "type": "custom",  
"tokenizer": "whitespace",  
"filter" : ["standard",  
"lowercase", "stop", "mynGram"]  
}  
},  
"filter" : {  
"mynGram" : {  
"type" : "nGram",  
"min\_gram" : 3,  
"max\_gram" : 10  
}  
}  
}  
},  
"mappings" : {  
"page" : {  
"properties": {  
"creator": { "type":"string", "store":"yes", "index" :  
"analyzed"},  
"modified": { "type":"date", "store":"yes",  
"index":"no", "format": "dd.mm.YYYY" },  
"content": { "type": "string", "store":"yes", "index" :  
"analyzed"},  
"title": {  
"type":"multi\_field",  
"fields": {  
"title": { "type": "string",  
"store":"yes", "index" : "analyzed"},  
"facet": { "type":"string", "index":  
"not\_analyzed" },

"autocomplete":{"analyzer":"autocomplete","type":"string"}  
}  
},  
"created": { "type":"date", "store":"yes",  
"index":"no", "format": "dd.mm.YYYY" }  
}  
}  
}  
}  
}

- 

second example: \*

when i try the same analyzer and this (example from the book), the index  
ignores the mapping

```
                    "title": {
                            "type":"multi_field",
                            "fields": {
                                "title": { "type": "string", 

```

"store":"yes", "index\_analyzer" : "autocomplete", "index" : "analyzed",  
"search\_analyzer" : "standard"},  
"facet": { "type":"string", "index":  
"not\_analyzed" }  
}  
},

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 19, 2013, 3:24pm UTC](https://discuss.elastic.co/t/autocomplete-in-mapping-does-not-work-mappingparsingexception/12837/2 "2013-07-19T15:24:44Z")

</div>

How are you adding the template to elasticsearch? Via a file or via the  
\_template API? If you submit incorrect JSON, does elasticsearch complain?

--  
Ivan

On Thu, Jul 18, 2013 at 2:13 AM, Sandra [marjorie01@gmx.de](mailto:marjorie01@gmx.de) wrote:

> Hi!
> 
> I'm working with elasticsearch 0.90. and searching for a way to  
> autocomplete some indexfields, when a user is typing some characters in the  
> searchfield. In my mapping-template  
> i have defined the analyzer and set it in the indexfield.
> 
> What am i doing wrong? The example for the autocomplete is from a blog and  
> the elasticsearch-book, i'm a little bit frustrated that it doesn't work ☹
> 
> Thanks!!!
> 
> - 
> 
> First example: \*  
> when i try this and want to setup a new index on the cluster, i get the  
> following exception:  
> _"MapperParsingException: Analyzer [autocomplete] not found for field  
> [autocomplete]"_
> 
> {  
> "default\_template" : {  
> "template" : "\*",  
> "settings" : {  
> "index": {  
> "number\_of\_shards": 2,  
> "number\_of\_replicas": 0  
> },  
> "analysis" : {  
> "analyzer" : {  
> "autocomplete" : { "type": "custom",  
> "tokenizer": "whitespace",  
> "filter" : ["standard",  
> "lowercase", "stop", "mynGram"]  
> }  
> },  
> "filter" : {  
> "mynGram" : {  
> "type" : "nGram",  
> "min\_gram" : 3,  
> "max\_gram" : 10  
> }  
> }  
> }  
> },  
> "mappings" : {  
> "page" : {  
> "properties": {  
> "creator": { "type":"string", "store":"yes", "index" :  
> "analyzed"},  
> "modified": { "type":"date", "store":"yes",  
> "index":"no", "format": "dd.mm.YYYY" },  
> "content": { "type": "string", "store":"yes", "index"  
> : "analyzed"},  
> "title": {  
> "type":"multi\_field",  
> "fields": {  
> "title": { "type": "string",  
> "store":"yes", "index" : "analyzed"},  
> "facet": { "type":"string", "index":  
> "not\_analyzed" },
> 
> "autocomplete":{"analyzer":"autocomplete","type":"string"}  
> }  
> },  
> "created": { "type":"date", "store":"yes",  
> "index":"no", "format": "dd.mm.YYYY" }  
> }  
> }  
> }  
> }  
> }
> 
> - 
> 
> second example: \*
> 
> when i try the same analyzer and this (example from the book), the index  
> ignores the mapping
> 
> ```
> "title": {
> "type":"multi_field",
> "fields": {
> "title": { "type": "string",
> 
> ```
> 
> "store":"yes", "index\_analyzer" : "autocomplete", "index" : "analyzed",  
> "search\_analyzer" : "standard"},  
> "facet": { "type":"string", "index":  
> "not\_analyzed" }  
> }  
> },
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:25am UTC](https://discuss.elastic.co/t/autocomplete-in-mapping-does-not-work-mappingparsingexception/12837/3 "2017-07-06T02:25:27Z")

</div>


