Add Field on the fly to the returned result

Hi,

Think about a elasticsearch query result where i get two matched documents in two buckets as below.

bucket1 =>

{
"product": "abc",
"price: "$100"
}

bucket2 =>

{
"product": "xyz",
"price": "$50"
}

now my requirement is that when it return these two buckets, is it possible to append a new FILED to the first bucket from same information that is found on the second bucket. So for example, new result from the elasticsearch would be;

bucket1 =>

{
"product": "abc",
"price: "$100",
"other similar product prices": "$50"
}

bucket2 =>

{
"product": "xyz",
"price": "$50"
}

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