Unable to set custom analyzer on text field


(Jannick) #1

Hi,

I'm trying to define a custom analyzer for use on a 'text' type field in Elasticsearch 6.3. At index creation time at get an error on the form:

Caused by: ElasticsearchException[Elasticsearch exception [type=mapper_parsing_exception, reason=Mapping definition for [myFulltextField] has unsupported parameters: [analyser : myAnalyzer]]]
at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:510)
at org.elasticsearch.ElasticsearchException.fromXContent(ElasticsearchException.java:421)
at org.elasticsearch.ElasticsearchException.innerFromXContent(ElasticsearchException.java:451)
at org.elasticsearch.ElasticsearchException.failureFromXContent(ElasticsearchException.java:617)
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:169)
... 29 more

I've tried to trim the definition to a bare minimum to see if incompatible options was the problem:

{
"settings": {
"analysis": {
"analyser": {
"myAnalyzer": {
"tokenizer": "standard"
}
}
}
},
"mappings": {
"doc": {
"myFulltextField": {
"type": "text",
"analyser": "myAnalyzer"
},
......
}
}
}

Any suggestion as to what is going wrong?


(David Pilato) #2

Change analyser by analyzer. I guess that should work better.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-custom-analyzer.html


(Jannick) #3

OMG.... I've looked at that and the documentation so many times.... Thank you.