Adding a field dinamically to search results

Hi,

I am a newbie into ElasticSearch and I am trying to figure out how to
achieve this:

In our Elastic Search Cluster we have documents like this:

{
"hotel" : "Hilton Maldives",
"location" : ...
}'

and what we want to achive is that when we search in Elastic Search, it
replies with this:

{
"hotel" : "Hilton Maldives",
"price" : 100$
"location" : ...
}'

this dynamic or synthetic field will come from an external service.

Of course, we can achieve this after the retrieval of all the hits of a
search, but for us the performance is a must, and we would like to add this
while the ES cluster is retrieving the items: that means for example, that
with 100 documents on 4 shards, distributed in 4 servers, each server will
add the "price" field to 25 documents (on an hypotetic match of the 100
documents)

As I understand, we need to create a plugin for Elastic Search, but after
two days looking where and how, I have not found any clear reference on how
to do it.

I would really appreciate any suggestion or help to this.

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/58ea0a0f-2216-4de2-a196-3fa11c44a5bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nobody has faced something like this before? :frowning:

El jueves, 25 de septiembre de 2014 18:33:08 UTC+2, Dani Castro escribió:

Hi,

I am a newbie into Elasticsearch and I am trying to figure out how to
achieve this:

In our Elastic Search Cluster we have documents like this:

{
"hotel" : "Hilton Maldives",
"location" : ...
}'

and what we want to achive is that when we search in Elastic Search, it
replies with this:

{
"hotel" : "Hilton Maldives",
"price" : 100$
"location" : ...
}'

this dynamic or synthetic field will come from an external service.

Of course, we can achieve this after the retrieval of all the hits of a
search, but for us the performance is a must, and we would like to add this
while the ES cluster is retrieving the items: that means for example, that
with 100 documents on 4 shards, distributed in 4 servers, each server will
add the "price" field to 25 documents (on an hypotetic match of the 100
documents)

As I understand, we need to create a plugin for Elastic Search, but after
two days looking where and how, I have not found any clear reference on how
to do it.

I would really appreciate any suggestion or help to this.

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b9b17199-447a-4146-b2ea-3481a60e4848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.