Map multiple values to a unique column in Elasticsearch

186 Views Asked by At

I want to work with Elasticsearch to process some Whatsapp chats. So I am initially planning the data load.

The problem is that the data exported from Whatsapp, doesn't contain a real unique id per user but it only contains the name of the user taken from the contact directory of the device where the chat is exported (ie. a user can change the number or have two numbers in the same group).

Because of that, I need to create a custom explicit mapping table between the user names and a self-generated unique id, that gets populated in an additional column.

Then, my question is: "How can I implement such kind of explicit mapping in Elasticsearch to generate an additional unique column?". Alternatively, a valid answer could be a totally different approach to the problem.

PS. As I write, I think the solution could be in the ingestion process, like in a python script, but I still want to post the question to understand if this is something that Elasticsearch can do by itself.

1

There are 1 best solutions below

0
warkolm On

yes, do it during the index process

if you had the data that maps the name and the id stored in a separate index you could do this with an enrich processor when you index the data to add whichever value you want to the document via a pipeline

also - Elasticsearch doesn't have columns, only fields