I am learning my ways around Elasticsearch. And I did index some documents, but then realized that I wanted to attach a specific analyzer to them.
But when I try to run "putMappings" command - it says Mapper for [short_summary] conflicts with existing mapping in other types
. As explained in this answer I can't change mappings on the existing field.
So that leaves me with only one option - to re-index documetns with analyzer set. But how do I do that?
The only code I made up is this:
$doc = ['short_summary' = '...text...'];
$params = [
'index' => 'index_name',
'type' => 'document_type',
'id' => $doc_id,
'body' => $doc,
];
$es_client->index($params);
Do you know the proper way to set the analyzer upon indexing a new document?