Define a callback to fetch results if none found

Hey there,

I am working on a web service that fetches data from various web
services and implements on top of them one common API and other
things. Next to fetching data I also aggregate data from various
places and now I am wondering if there is some mode or way to tell
elasticsearch "Call this url if you find nothing" - this callback
would be some service of mine that returns data exactly the way
elasticsearch does.

So that it queries the callback exactly the way it would query another
node (afair this is done with REST too, isn't it?) but the callback
returns some other aggregated data.

Are there some way to achieve this?

Regards,
Christopher.

Not within elasticsearch. You could potentially write a plugin that does
that, expose your own REST endpoint (assuming you only care about REST)
which works in a similar manner to the search endpoint, and goes and fetches
the relevant data.

Personally, I don't think that such logic belongs in elasticsearch.

On Sun, Aug 28, 2011 at 9:22 AM, Christopher Grebs cgrebs@googlemail.comwrote:

Hey there,

I am working on a web service that fetches data from various web
services and implements on top of them one common API and other
things. Next to fetching data I also aggregate data from various
places and now I am wondering if there is some mode or way to tell
elasticsearch "Call this url if you find nothing" - this callback
would be some service of mine that returns data exactly the way
elasticsearch does.

So that it queries the callback exactly the way it would query another
node (afair this is done with REST too, isn't it?) but the callback
returns some other aggregated data.

Are there some way to achieve this?

Regards,
Christopher.

Yea, I don't think either that this belongs to Elasticsearch but I
always think that if I already can use some cool cluster management
like ES has I could reuse it.

I guess I need to write such a wrapper myself then. But thanks nevertheless.

Regards,
Christopher.

On Mon, Aug 29, 2011 at 7:56 PM, Shay Banon kimchy@gmail.com wrote:

Not within elasticsearch. You could potentially write a plugin that does
that, expose your own REST endpoint (assuming you only care about REST)
which works in a similar manner to the search endpoint, and goes and fetches
the relevant data.
Personally, I don't think that such logic belongs in elasticsearch.

On Sun, Aug 28, 2011 at 9:22 AM, Christopher Grebs cgrebs@googlemail.com
wrote:

Hey there,

I am working on a web service that fetches data from various web
services and implements on top of them one common API and other
things. Next to fetching data I also aggregate data from various
places and now I am wondering if there is some mode or way to tell
elasticsearch "Call this url if you find nothing" - this callback
would be some service of mine that returns data exactly the way
elasticsearch does.

So that it queries the callback exactly the way it would query another
node (afair this is done with REST too, isn't it?) but the callback
returns some other aggregated data.

Are there some way to achieve this?

Regards,
Christopher.