I am quite new to painless or any kind of scripting in elastic.
I wanted to know how do i execute a script in elastic.
Scenario: I have a mapping.json
, with all the fields to be indexed in elastic. I am using elasticsearchjs npm module as my code is in typescript. So to execute the script which is basically adding a new field to an existing document. Looks somewhat like this "ctx._source.name = SZ_MK.pdf"
.
Now my question is where do i add -->
"inline": "ctx._source.name = SZ_MK.pdf",
"lang": "painless"
}
so that it gets executed is it within mappings
or somewhere else?