Generate a UUID using randomuuid in painless


I need help please,
i want to generate a UUID code with Painless language.
I know that exists something like UUID.randomuuid() in Groovy, but is does not work in Painless.

Thank you !

you cannot use this method, as it is not whitelisted in painless. Can you explain your use-case a bit, what exactly you need to do?

Thank you !

I just want to generate a unique ID for each doc.

if you need this for indexing documents, Elasticsearch can autogenerate one for you, if you omit the id in the index action.

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