ElasticSearch: Allow only local requests

Hi All,

i am trying search data from remote server using Elastic search java api

i have made changes in elasticsearch.yml

network.host: "10.0.0.12" .. (remote server ip )

and in java

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

SearchResponse response = null;
response =
client.prepareSearch().setQuery(QueryBuilders.queryString(""+searchText+"").field("userName").field("firstName").field("displayName").field("lastName").field("email").field("phoneNumber").field("alternativeContact").field("office").field("practice").field("role").field("additionalFields").field("createdBy").field("modifiedBy")).setFrom(0).setSize(25).setIndices("dc_user_idx")
.setTypes("DC_USER").execute().actionGet();

for (SearchHit hit : results) {
result.put(""+count, hit.getSource()); // the retrieved document
list.add(hit.getSource());
}

i am getting node not available exception

is there anything missing
please can any one help me..

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I'm just wondering why you don't follow Igor's advices?
Why are you opening new threads again and again with the same question, with the same code?

Don't repeat yourself.

Igor's advice was: "You need to specify cluster name when you create transport client. See the second example in the Transport Client section on this page Elasticsearch Platform — Find real-time answers at scale | Elastic"

So please, read this page carefully and you should find how to connect to your running node.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 20 mars 2013 à 09:36, srikanth gone srikanthg93@gmail.com a écrit :

Hi All,

i am trying search data from remote server using Elastic search java api

i have made changes in elasticsearch.yml

network.host: "10.0.0.12" .. (remote server ip )

and in java

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

SearchResponse response = null;
response = client.prepareSearch().setQuery(QueryBuilders.queryString(""+searchText+"").field("userName").field("firstName").field("displayName").field("lastName").field("email").field("phoneNumber").field("alternativeContact").field("office").field("practice").field("role").field("additionalFields").field("createdBy").field("modifiedBy")).setFrom(0).setSize(25).setIndices("dc_user_idx")
.setTypes("DC_USER").execute().actionGet();

for (SearchHit hit : results) {
result.put(""+count, hit.getSource()); // the retrieved document
list.add(hit.getSource());
}

i am getting node not available exception

is there anything missing
please can any one help me..

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.