How to add new data to particular field from another index?

I have two index one index having a field called "authorId" and another index have details belongs to that authorid. i want to bring the details to the first index, how to do this efficiently.

EXAMPLE:
INDEX-1
{
"authorId": 1,
"date": "23-2-2108"
}

INDEX-2
{
"authorId": 1,
"name": "arun",
"age": 24
}

RESULT I WANT
INDEX-1
{
"authorId": 1,
"date": "23-2-2108",
"name": "arun",
"age": 24
}

Late reply, but I suspect the only approach here is to script it. For each doc in index-1:

  • get data from index-1
  • get data from index-2
  • 'merge' the data by whatever rules you want
  • update the doc in index-1

Might take a while, but seems the most practical. I'd consider getting index-1 results via scan and then getting the associated doc from index-2.

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