Autocomplete in Mapping does not work - MappingParsingException?

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 :frowning:

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.
For more options, visit https://groups.google.com/groups/opt_out.

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 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 :frowning:

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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.