Hi,
I need to check if fieldX exists in each document in the Index. Then for those which it doesn't, I would like to get the value of fieldY of the same document, run a python function on that field and store the result in the fieldX.
doc1.fieldX = doesn't exist
doc1.fieldY = "This is a text that a python function will analyse it"
pythonFunction(doc1.fieldY) = ["text","python","function"]
In the end, after the update, I should have something like:
doc1.fieldX = ["text","python","function"]
doc1.fieldY = "This is a text that a python function will analyse it"
I just learnt about "file-based scripts" concept in elasticsearch. Wondering if it's better that I use this concept and update the data or I'd better handle everything from Python(connect to db, read data, get the value of each fieldY, update fieldX accordingly)?
Thanks,
Ellie