Search Plugin to intercept search response

Hi,

Is there any action/module that I can extend/register/add so that I can
intercept the SearchResponse on the server node before the response is sent
back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I can
intercept the SearchResponse on the server node before the response is sent
back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant to my
functional use case. But I will be using the TransportClient Java API, not
the REST client.

Can you please tell me how I can find/modify these classes/sources to get
the appropriate classes for inctercepting the Search Response when invoked
from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I can
intercept the SearchResponse on the server node before the response is sent
back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You can receive the SearchResponse, process the response, and return the
response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant to my
functional use case. But I will be using the TransportClient Java API, not
the REST client.

Can you please tell me how I can find/modify these classes/sources to get
the appropriate classes for inctercepting the Search Response when invoked
from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I can
intercept the SearchResponse on the server node before the response is sent
back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

When you say, 'receive the SearchResponse', is that in the ES Server node
or the TransportClient node that spawned the request? I would want to
intercept the SearchResponse when created at the ES Server itself, since I
want to send the subset of Response to another process on the same node,
and it would not be very efficient to have the response sent back to the
client node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can receive the SearchResponse, process the response, and return the
response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant to
my functional use case. But I will be using the TransportClient Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources to get
the appropriate classes for inctercepting the Search Response when invoked
from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I can
intercept the SearchResponse on the server node before the response is sent
back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You can not intercept the SearchResponse on the ES server itself. Instead,
you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

When you say, 'receive the SearchResponse', is that in the ES Server node
or the TransportClient node that spawned the request? I would want to
intercept the SearchResponse when created at the ES Server itself, since I
want to send the subset of Response to another process on the same node,
and it would not be very efficient to have the response sent back to the
client node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can receive the SearchResponse, process the response, and return the
response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant to
my functional use case. But I will be using the TransportClient Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources to
get the appropriate classes for inctercepting the Search Response when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I
can intercept the SearchResponse on the server node before the response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thanks for bearing with me till now :slight_smile: Please provide one final input on
this issue.

Is there any example for a custom search action? If not, can you please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can not intercept the SearchResponse on the ES server itself. Instead,
you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

When you say, 'receive the SearchResponse', is that in the ES Server node
or the TransportClient node that spawned the request? I would want to
intercept the SearchResponse when created at the ES Server itself, since I
want to send the subset of Response to another process on the same node,
and it would not be very efficient to have the response sent back to the
client node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can receive the SearchResponse, process the response, and return the
response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant to
my functional use case. But I will be using the TransportClient Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources to
get the appropriate classes for inctercepting the Search Response when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I
can intercept the SearchResponse on the server node before the response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Yes. I have checked in some code for a simple action plugin.

The plugin implements a simple "match_all" search action, by reusing much
of the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final input on
this issue.

Is there any example for a custom search action? If not, can you please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

When you say, 'receive the SearchResponse', is that in the ES Server
node or the TransportClient node that spawned the request? I would want to
intercept the SearchResponse when created at the ES Server itself, since I
want to send the subset of Response to another process on the same node,
and it would not be very efficient to have the response sent back to the
client node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

You can receive the SearchResponse, process the response, and return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode <
k.sandeep.r@gmail.com> wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant
to my functional use case. But I will be using the TransportClient Java
API, not the REST client.

Can you please tell me how I can find/modify these classes/sources to
get the appropriate classes for inctercepting the Search Response when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com <
joergprante@gmail.com> wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I
can intercept the SearchResponse on the server node before the response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav

2014-09-11 20:44 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

Yes. I have checked in some code for a simple action plugin.

GitHub - jprante/elasticsearch-simple-action-plugin: A simple action plugin for Elasticsearch

The plugin implements a simple "match_all" search action, by reusing much of
the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final input on
this issue.

Is there any example for a custom search action? If not, can you please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

When you say, 'receive the SearchResponse', is that in the ES Server
node or the TransportClient node that spawned the request? I would want to
intercept the SearchResponse when created at the ES Server itself, since I
want to send the subset of Response to another process on the same node, and
it would not be very efficient to have the response sent back to the client
node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can receive the SearchResponse, process the response, and return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant
to my functional use case. But I will be using the TransportClient Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources to
get the appropriate classes for inctercepting the Search Response when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that I
can intercept the SearchResponse on the server node before the response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxhZ6t_7hx30QoD30f3B3erP499JSHCTGxAQvJ518fFv8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

You must set up a cluster name in the settings for the TransportClient,
otherwise connection requests will be rejected by the cluster.

Also, a dynmaic "new TransportClient()" for client instantiation is
discouraged. By doing this, you open up a new threadpool each time.
Recommend is to use a singleton instantiation for the whole JVM, and a
single close() call on the TransportClient instance when JVM exits.

Jörg

On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak tpoljak@gmail.com wrote:

Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav

2014-09-11 20:44 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

Yes. I have checked in some code for a simple action plugin.

GitHub - jprante/elasticsearch-simple-action-plugin: A simple action plugin for Elasticsearch

The plugin implements a simple "match_all" search action, by reusing
much of
the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final input on
this issue.

Is there any example for a custom search action? If not, can you please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

When you say, 'receive the SearchResponse', is that in the ES Server
node or the TransportClient node that spawned the request? I would
want to
intercept the SearchResponse when created at the ES Server itself,
since I
want to send the subset of Response to another process on the same
node, and
it would not be very efficient to have the response sent back to the
client
node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can receive the SearchResponse, process the response, and return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are relevant
to my functional use case. But I will be using the TransportClient
Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources
to
get the appropriate classes for inctercepting the Search Response
when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that
I
can intercept the SearchResponse on the server node before the
response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxhZ6t_7hx30QoD30f3B3erP499JSHCTGxAQvJ518fFv8A%40mail.gmail.com
.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoEkFOeT4x7qi365MQ8Kz6f1YXWMc0-vV%2B0ur9PBYDAWSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Jörg,
thanks for response!

I use default 'elasticsearch' cluster name and 'ordinary' match_all (as below)

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
SearchResponse response = client.prepareSearch().execute().actionGet();

works fine (connects,executes and returns results). However, I can't
execute SimpleAction successfully over TransportClient (even with
cluster name set):

Client client = new
TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name",
"elasticsearch")).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

SimpleRequestBuilder builder = new SimpleRequestBuilder(client);
SearchResponse response = client.execute(SimpleAction.INSTANCE,
builder.request()).actionGet();

Both, elasticsearch server and client using TransportClient report
'simple action' plugin loaded (in console INFO), but on execute I get
NPE on the client's side with trace:

org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
Failed execution
at org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:90)
at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:50)
at org.xbib.elasticsearch.action.simple.SimpleActionTest.testSimpleAction(SimpleActionTest.java:26)
..

Caused by: java.lang.NullPointerException
at org.elasticsearch.action.search.SearchRequest.writeTo(SearchRequest.java:541)
at org.xbib.elasticsearch.action.simple.SimpleRequest.writeTo(SimpleRequest.java:38)

Am I missing or misunderstanding something?

Tomislav

2014-10-18 15:28 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

You must set up a cluster name in the settings for the TransportClient,
otherwise connection requests will be rejected by the cluster.

Also, a dynmaic "new TransportClient()" for client instantiation is
discouraged. By doing this, you open up a new threadpool each time.
Recommend is to use a singleton instantiation for the whole JVM, and a
single close() call on the TransportClient instance when JVM exits.

Jörg

On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak tpoljak@gmail.com wrote:

Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav

2014-09-11 20:44 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

Yes. I have checked in some code for a simple action plugin.

GitHub - jprante/elasticsearch-simple-action-plugin: A simple action plugin for Elasticsearch

The plugin implements a simple "match_all" search action, by reusing
much of
the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final input
on
this issue.

Is there any example for a custom search action? If not, can you please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

When you say, 'receive the SearchResponse', is that in the ES Server
node or the TransportClient node that spawned the request? I would
want to
intercept the SearchResponse when created at the ES Server itself,
since I
want to send the subset of Response to another process on the same
node, and
it would not be very efficient to have the response sent back to the
client
node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can receive the SearchResponse, process the response, and return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are
relevant
to my functional use case. But I will be using the TransportClient
Java API,
not the REST client.

Can you please tell me how I can find/modify these classes/sources
to
get the appropriate classes for inctercepting the Search Response
when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Have a look at array-format or csv plugin, they are processing the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so that
I
can intercept the SearchResponse on the server node before the
response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxhZ6t_7hx30QoD30f3B3erP499JSHCTGxAQvJ518fFv8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoEkFOeT4x7qi365MQ8Kz6f1YXWMc0-vV%2B0ur9PBYDAWSg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxgt25g1RHJuaVSZ37LLw-%3D%2BDAD0hY6gS8kCGh3zG_4KUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

If you use TransportClient, implementing custom actions like SimpleAction
gets a bit tricky: you must install the plugin both on the cluster on all
nodes and on the TransportClient classpath.

The reason is, the TransportClient initiates a proxy action to ask the
cluster to execute the action for him. A NodeClient runs in a single JVM
with a cluster node and does not need such a proxy action.

Jörg

On Mon, Oct 20, 2014 at 3:09 PM, Tomislav Poljak tpoljak@gmail.com wrote:

Hi Jörg,
thanks for response!

I use default 'elasticsearch' cluster name and 'ordinary' match_all (as
below)

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
SearchResponse response = client.prepareSearch().execute().actionGet();

works fine (connects,executes and returns results). However, I can't
execute SimpleAction successfully over TransportClient (even with
cluster name set):

Client client = new
TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name",
"elasticsearch")).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

SimpleRequestBuilder builder = new SimpleRequestBuilder(client);
SearchResponse response = client.execute(SimpleAction.INSTANCE,
builder.request()).actionGet();

Both, elasticsearch server and client using TransportClient report
'simple action' plugin loaded (in console INFO), but on execute I get
NPE on the client's side with trace:

org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
Failed execution
at
org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:90)
at
org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:50)
at
org.xbib.elasticsearch.action.simple.SimpleActionTest.testSimpleAction(SimpleActionTest.java:26)
..

Caused by: java.lang.NullPointerException
at
org.elasticsearch.action.search.SearchRequest.writeTo(SearchRequest.java:541)
at
org.xbib.elasticsearch.action.simple.SimpleRequest.writeTo(SimpleRequest.java:38)

Am I missing or misunderstanding something?

Tomislav

2014-10-18 15:28 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

You must set up a cluster name in the settings for the TransportClient,
otherwise connection requests will be rejected by the cluster.

Also, a dynmaic "new TransportClient()" for client instantiation is
discouraged. By doing this, you open up a new threadpool each time.
Recommend is to use a singleton instantiation for the whole JVM, and a
single close() call on the TransportClient instance when JVM exits.

Jörg

On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak tpoljak@gmail.com
wrote:

Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav

2014-09-11 20:44 GMT+02:00 joergprante@gmail.com <joergprante@gmail.com
:

Yes. I have checked in some code for a simple action plugin.

GitHub - jprante/elasticsearch-simple-action-plugin: A simple action plugin for Elasticsearch

The plugin implements a simple "match_all" search action, by reusing
much of
the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final input
on
this issue.

Is there any example for a custom search action? If not, can you
please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

When you say, 'receive the SearchResponse', is that in the ES
Server
node or the TransportClient node that spawned the request? I would
want to
intercept the SearchResponse when created at the ES Server itself,
since I
want to send the subset of Response to another process on the same
node, and
it would not be very efficient to have the response sent back to
the
client
node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can receive the SearchResponse, process the response, and
return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are
relevant
to my functional use case. But I will be using the
TransportClient
Java API,
not the REST client.

Can you please tell me how I can find/modify these
classes/sources
to
get the appropriate classes for inctercepting the Search Response
when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Have a look at array-format or csv plugin, they are processing
the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so
that
I
can intercept the SearchResponse on the server node before the
response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic
in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email
to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email
to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.

To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxhZ6t_7hx30QoD30f3B3erP499JSHCTGxAQvJ518fFv8A%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoEkFOeT4x7qi365MQ8Kz6f1YXWMc0-vV%2B0ur9PBYDAWSg%40mail.gmail.com
.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxgt25g1RHJuaVSZ37LLw-%3D%2BDAD0hY6gS8kCGh3zG_4KUQ%40mail.gmail.com
.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoHG8-iLuR90BWc9Lc1CLF20892bnOWV18P%3Df0ktY0tayA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Jörg,
I understand and what you described is exactly what I did: deployed
plugin to both elasticsearch node/server (running single node cluster
atm) and to the client code classpath which uses TransportClient ->
both log INFO 'simple action plugin loaded' on start, yet I can't
execute simple action successfully from client using TransportClient
(without NPE).

So, I'm wondering if custom actions can be executed thru the
TransportClient at all or are custom TransportActions actually
'internal node actions' which can only be executed on node (which
expands query and reduces results from other nodes/shards on the
client node - inside client jvm).

I wonder because seems to me like its not even plugin loading related
issue, but actually a problem of 'internal' type of call execution ->
for example, I get the same NPE when executing typical search request
using SearchAction.INSTANCE 'internal approach':

SearchRequestBuilder builder = new SearchRequestBuilder(client);
SearchResponse response = client.execute(SearchAction.INSTANCE,
builder.request()).actionGet();

over TransportClient, while again this call works perfectly fine over
node client.

Do you have some setup where you consume custom actions using
TransportClient (not rest and not node type of client)?

Thanks,
Tomislav

2014-10-20 17:21 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

If you use TransportClient, implementing custom actions like SimpleAction
gets a bit tricky: you must install the plugin both on the cluster on all
nodes and on the TransportClient classpath.

The reason is, the TransportClient initiates a proxy action to ask the
cluster to execute the action for him. A NodeClient runs in a single JVM
with a cluster node and does not need such a proxy action.

Jörg

On Mon, Oct 20, 2014 at 3:09 PM, Tomislav Poljak tpoljak@gmail.com wrote:

Hi Jörg,
thanks for response!

I use default 'elasticsearch' cluster name and 'ordinary' match_all (as
below)

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
SearchResponse response = client.prepareSearch().execute().actionGet();

works fine (connects,executes and returns results). However, I can't
execute SimpleAction successfully over TransportClient (even with
cluster name set):

Client client = new
TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name",
"elasticsearch")).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

SimpleRequestBuilder builder = new SimpleRequestBuilder(client);
SearchResponse response = client.execute(SimpleAction.INSTANCE,
builder.request()).actionGet();

Both, elasticsearch server and client using TransportClient report
'simple action' plugin loaded (in console INFO), but on execute I get
NPE on the client's side with trace:

org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
Failed execution
at
org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:90)
at
org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:50)
at
org.xbib.elasticsearch.action.simple.SimpleActionTest.testSimpleAction(SimpleActionTest.java:26)
..

Caused by: java.lang.NullPointerException
at
org.elasticsearch.action.search.SearchRequest.writeTo(SearchRequest.java:541)
at
org.xbib.elasticsearch.action.simple.SimpleRequest.writeTo(SimpleRequest.java:38)

Am I missing or misunderstanding something?

Tomislav

2014-10-18 15:28 GMT+02:00 joergprante@gmail.com joergprante@gmail.com:

You must set up a cluster name in the settings for the TransportClient,
otherwise connection requests will be rejected by the cluster.

Also, a dynmaic "new TransportClient()" for client instantiation is
discouraged. By doing this, you open up a new threadpool each time.
Recommend is to use a singleton instantiation for the whole JVM, and a
single close() call on the TransportClient instance when JVM exits.

Jörg

On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak tpoljak@gmail.com
wrote:

Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav

2014-09-11 20:44 GMT+02:00 joergprante@gmail.com
joergprante@gmail.com:

Yes. I have checked in some code for a simple action plugin.

GitHub - jprante/elasticsearch-simple-action-plugin: A simple action plugin for Elasticsearch

The plugin implements a simple "match_all" search action, by reusing
much of
the code of the search action.

Best,

Jörg

On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Thanks for bearing with me till now :slight_smile: Please provide one final
input
on
this issue.

Is there any example for a custom search action? If not, can you
please
provide some details on how I can implement one?

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 4:53 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can not intercept the SearchResponse on the ES server itself.
Instead, you must implement your custom search action.

Jörg

On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

When you say, 'receive the SearchResponse', is that in the ES
Server
node or the TransportClient node that spawned the request? I would
want to
intercept the SearchResponse when created at the ES Server itself,
since I
want to send the subset of Response to another process on the same
node, and
it would not be very efficient to have the response sent back to
the
client
node only to be sent back again.

Thanks,
Sandeep

On Thu, Sep 11, 2014 at 12:43 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

You can receive the SearchResponse, process the response, and
return
the response with whatever format you want.

Jörg

On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
k.sandeep.r@gmail.com wrote:

Hi Jorg,

Thanks for the links. I was checking the sources. There are
relevant
to my functional use case. But I will be using the
TransportClient
Java API,
not the REST client.

Can you please tell me how I can find/modify these
classes/sources
to
get the appropriate classes for inctercepting the Search
Response
when
invoked from a TransportClient?

Thanks,
Sandeep

On Wed, Aug 27, 2014 at 6:38 PM, joergprante@gmail.com
joergprante@gmail.com wrote:

Have a look at array-format or csv plugin, they are processing
the
SearchResponse to output it in another format:

https://github.com/jprante/elasticsearch-arrayformat

GitHub - jprante/elasticsearch-csv: CSV format for Elasticsearch REST search responses

Jörg

On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
elasticsearch elasticsearch@googlegroups.com wrote:

Hi,

Is there any action/module that I can extend/register/add so
that
I
can intercept the SearchResponse on the server node before the
response is
sent back to the TransportClient on the calling box?

Thanks,
Sandeep

--
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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic
in
the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an
email
to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90bENin_aU4AXa%3DTVHQ_SyTTn-89Rev5vjj3%3DoDikwstkQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic
in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGWm8upDW9De7OvkM0cps%2BEyn3goo7Tgy3jyqJ8Jz5Khw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90aQiQO-cFzVb3vi_h7Buf1NLyk_q3UOqLRMe0ZDsvQ_MA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in
the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit

https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit

https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEk0-VccZES3wNn8mEAbcuCJFV%3D8HKjw0udCAU-ysWXTA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKnM90ZFshVUHHQM6fd0K9VCa14n0MDzUCxtu6zYV4kFciuBSQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoENDoJG8Nkbd4%3Djn9kQH_O75pf5_ShaYy9rQy08NUYnvA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxhZ6t_7hx30QoD30f3B3erP499JSHCTGxAQvJ518fFv8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoEkFOeT4x7qi365MQ8Kz6f1YXWMc0-vV%2B0ur9PBYDAWSg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxgt25g1RHJuaVSZ37LLw-%3D%2BDAD0hY6gS8kCGh3zG_4KUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/CAKdsXoHG8-iLuR90BWc9Lc1CLF20892bnOWV18P%3Df0ktY0tayA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

--
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/CALuCJxh1Xj7%3D_oD%3Duwkgk%2BLwDumiKmtdg365%3D%2BX2e%2B0DHo1hww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I know this is a 2 years old post but I'm trying to build something very similar to the example that jprante has in https://github.com/jprante/elasticsearch-simple-action-plugin. I'm tyring to build the plugin for ES 2.3, the problem is that for the particular class:
TransportSimpleAction ,I see that it's just a copy of the code from TransportSearchAction. I've tried to do the same in 2.3.x but i get a lot of errors regarding AbstractSearchAsyncAction , SearchQueryThenFetchAsyncAction and other same type AsyncActions . Because now the classes are package private. What i intend to do is just to intercept the incoming query at the server side and modify it to add an additional filter, i already have the code to modify the query, I'm just lost in the code to have it in a SearchAction plugin. Thanks in advance.

Thanks for your interest in my plugin.

I have updated the demo plugin at https://github.com/jprante/elasticsearch-simple-action-plugin to Elasticsearch 2.3.4

The trick is to place your custom transport action implementation under the org.elasticsearch.action.search package to get package private access to the helper classes.

Hi Jörg,
thanks for your response. I followed your changes and it works, but now i'm having an issue with the transport layer : when i send the request to the server it throws an IllegalStateException :

java.lang.IllegalStateException: Message not fully read (request) for requestId [2], action [indices:data/read/secure_search], readerIndex [53] vs expected [171]; resetting
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:121)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

In with the client node in the unit tests it doesn't fail.
I suspect that it's expecting far less bytes than what i'm sending to the message handler. But not sure how to debug it directly in the server.
Thanks for any comment.

That means that you have made coding or installation mistakes. It's not possible to comment on stack traces without the code that causes it. Can I see your code? What action is indices:data/read/secure_search?

Why don't you use the code like in the unit test?

Yes it seems that it didn't like my custom builder with encapsulated builder. I changed that anyways. Creating just the custom Action, and custom TransportAction. I'm using the same SearchRequest and SearchRequesBuilder as the return type for the newRequestBuilder method in my custom Action.
My custom code is only on the custom TransportAction (actually right now it's commented out to avoid interference, and it's doing the same as the SearchTransportAction would do)
The unit tests work (unit tests similar to what you have in your plugin). I install the plugin normally in the server (all is in the same version).

See the plugin class:
SecureRestSearchActionPlugin.java

The Custom Action (see that the action is using the OOTB SearchRequest and SearchRequestBuilder):

SecureSearchAction.java

And the custom TransportAction:

TransportSecureSearchAction.java

And then from a separate project and jvm i call the plugin using the TransportClient like:

Calling code

When i run this latest i get the stack trace:

Stacktrace 1

I've also installed your plugin and i have the same issue when calling from a remote TransportClient. (Actually i couldn't run your plugin without modifying SimpleRequest and implementing the interface IndicesRequest.Replaceable because ES was complaining that the indices where null)

I've read that you cannot use classes with private package access from different jars and class loader, not sure how to work around this. I couldn't extend from SearchTransportAction and just add my functionality overrinding the doExecute method, because the actionName variable is final and it can only be set from the protected construction in TransportAction. So if i do an extension i will be passing the SearchAction name instead of my custom name (and the custom code won't be called).

I also tried to encapsulate the SearchTransportAction in SecureTransportAction like:

TransportSecureSearchAction_encapsulated

But then i get a similar stack trace from the code using the TransportClient :

Stacktrace 2

Any thoughts ?

Hi Jörg,

I tried executing the simple action through a rest handler and keep getting the error
java.lang.IllegalAccessError: tried to access class org.elasticsearch.action.search.SearchQueryThenFetchAsyncAction from class org.elasticsearch.action.search.TransportSimpleAction
Any idea why this might be happening ?