Hello,
We are trying to upgrade from ES version 2.3.1 to 5.1.1. So now I'm changing the code to create the index and the mapping, but I'm getting this strange error message.
Elasticsearch Error: mapper_parsing_exception: Mapping definition for [fields] has unsupported parameters: [analyzer : lowercase] (400)
The code I use to create the index and mapping:
$aParams = [
'index' => 'my_index',
'body' => [
'settings' => [
'analysis' => [
'analyzer' => [
'lowercase' => [
'type' => 'custom',
'tokenizer' => 'keyword',
'filter' => [ 'lowercase' ],
]
]
]
]
]
];
$oElastic->indices()->create( $aParams );
$aMapping = [
'index' => 'my_index',
'type' => 'my_type',
'body' => [
'my_type' => [
'_source' => [
'enabled' => true,
],
'properties' => [
'my_field' => [
'type' => 'keyword',
'analyzer' => 'dutch',
'fields' => [
'lowercase' => [
'type' => 'keyword',
'analyzer' => 'lowercase',
],
'raw' => [
'type' => 'keyword',
'index' => false,
]
]
]
]
]
]
];
$oElastic->indices()->putMapping( $aMapping );
Any thoughts?