ElasticsearchIllegalArgumentException[failed to find analyzer type [null] or tokenizer for [autocomplete]]


(Gene Aiello) #1

I am trying to add autocomplete to my search index.
I am struggling to trying to get the syntax correct.
I have search and found solutions to similar solutions but still can't seem
to get my syntax to work.
Please tell me what is wrong....

PUT /my_index
{
"settings": {
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edgeNGram",
"min_gram": 2,
"max_gram": 20,
"token_chars": [
"letter",
"digit"
]
}
},
"analyzer": {
"my_standard_analyzer": {
"type": "standard",
"stopwords": []
},
"autocomplete": {
"title": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
}
}
}
},
"mappings": {
"title": {
"properties": {
"title": {
"type": "multi_field",
"fields": {
"title": {
"type": "string",
"analyzer": "title"
},
"autocomplete": {
"type": "string",
"index_analyzer": "autocomplete",
"search_analyzer": "title"
}
}
}
}
}
}
}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/30b02d2d-bc0e-4774-9057-3a2ed10abb3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Gene Aiello) #2

I am going to answer my own question and hope it helps someone else, below
is how I fixed it.
A few things were wrong, but I was also using the wrong names of my
analyzers in my mappings...

PUT /de_assets_index
{
"settings":{
"analysis":{
"filter":{
"autocomplete_filter":{
"type":"edge_ngram",
"min_gram":1,
"max_gram":20,
"token_chars": [
"letter",
"digit"
]
}
},
"analyzer":{
"autocomplete":{
"type":"custom",
"tokenizer":"standard",
"filter":[
"lowercase",
"autocomplete_filter"
]
},
"my_standard_analyzer": {
"type": "standard",
"stopwords": []
}
}
}
},
"mappings": {
"title": {
"properties": {
"title": {
"type": "multi_field",
"fields": {
"title": {
"type": "string",
"analyzer": "my_standard_analyzer"
},
"autocomplete": {
"type": "string",
"index_analyzer": "autocomplete",
"search_analyzer": "my_standard_analyzer"
}
}
}
}
}
}
}

On Friday, April 25, 2014 3:29:05 PM UTC-5, Gene Aiello wrote:

I am trying to add autocomplete to my search index.
I am struggling to trying to get the syntax correct.
I have search and found solutions to similar solutions but still can't
seem to get my syntax to work.
Please tell me what is wrong....

PUT /my_index
{
"settings": {
"analysis": {
"filter": {
"autocomplete_filter": {
"type": "edgeNGram",
"min_gram": 2,
"max_gram": 20,
"token_chars": [
"letter",
"digit"
]
}
},
"analyzer": {
"my_standard_analyzer": {
"type": "standard",
"stopwords": []
},
"autocomplete": {
"title": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"autocomplete_filter"
]
}
}
}
}
},
"mappings": {
"title": {
"properties": {
"title": {
"type": "multi_field",
"fields": {
"title": {
"type": "string",
"analyzer": "title"
},
"autocomplete": {
"type": "string",
"index_analyzer": "autocomplete",
"search_analyzer": "title"
}
}
}
}
}
}
}

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5cf77e2e-33e8-44a4-b95b-e17f0527f653%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3