Re: How to query custom rest handler in elastic search using Java api

2014-01-08 Thread Shishir Kumar
Hi,

I am not facing any issue with the NodesInfoAction or the custom endpoint 
code. The rest endpoint is working fine, if I curl to it using:curl -XGET '
localhost:9200/_mastering/nodes?prettyhttp://10.114.24.132:9200/_mastering/nodes?pretty
'.

I am trying to find out a way to do this from an embedded node. In other 
words, somthing like below:

Node node = 
NodeBuilder.nodeBuilder().clusterName(elasticsearch).node();
Client client = node.client();
SearchResponse response = 
client.prepareSearch().setSearchType(/_mastering/nodes).
setQuery(QueryBuilders.queryString()).
execute().actionGet();

P.S. the code snippet doesn't actually work. But I want to query the 
/_mastering/nodes through Java api.

On Friday, 3 January 2014 13:35:13 UTC+5:30, Jörg Prante wrote:

 You have wrapped a NodesInfoAction, so all you have to do is

 NodesInfoResponse response = client.admin().cluster().
 prepareNodesInfo().all().execute().actionGet();

 That is the Java API.

 Jörg



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/bc517dbc-8dfc-4b8e-a9b3-567d87cc734c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


How to query custom rest handler in elastic search using Java api

2014-01-02 Thread Shishir Kumar
Hi,
I have implemented a simple custom rest handler class for elastic search. 
If I need to call it using curl it works just fine.
curl -XGET '10.114.24.132:9200/_mastering/nodes?pretty'

However, I want to call this using the elastic search Java api (with an 
embedded client node). Could you please help me with this? I am new to 
elastic search and not able to figure this out.

P.S. I had followed the instructions given in the link 
http://elasticsearchserverbook.com/creating-custom-elasticsearch-rest-action/ 
for setting up the custom handler.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/6a352a4d-3ac6-4970-95de-80d56e4d7dec%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.