Formatting field values? Or how to write this particular script preprocessor?

I have documents in my index that have a field whose value is a string of numbers, "." and -. I want to remove those . and - from the values and change the field type to an integer.

I can have these removed before I feed my data to elasticsearch, but then I still have the problem with the existing indexed documents.

I believe the solution is to define an ingest node and add it to the a new index's mapping, then reindex and alias the old one. However I simply can't write the conditional removal of . and - using painless in a script preprocessor! And I didn't understand the documentation.

How do I write it?!



This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.