Index not recognized from java api

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as Standalone. I have created index using 'curl -XPUT 'http://localhost:9200/test/''. I could also see empty mapping for '''test' when I run curl -XGET http://localhost:9200/_mapping, but the call to 'client.admin().indices().prepareExists("test").execute().actionGet().exists()' returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

How do you create you client? While creating a new node client, it's
possible to inadvertently create a new data node instead. It it happend to
you it's possible that your new node didn't join another node and simply
unaware of the new index test. Try this:

    Settings settings = settingsBuilder().put("cluster.name", "*your 

cluster name*").build();

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

System.out.println(client.admin().indices().prepareExists("test").execute().actionGet().exists());

    client.close();

Make sure that your are using the same version of Elasticsearch on both
client and server.

On Friday, March 22, 2013 3:24:51 AM UTC-4, Chetana wrote:

I am new to ElasticSearch. Using Elastic search(version 0.20.5) as
Standalone. I have created index using 'curl -XPUT
'http://localhost:9200/test/''. I could also see empty mapping for
'''test'
when I run curl -XGET http://localhost:9200/_mapping, but the call to
'client.admin().indices().prepareExists("test").execute().actionGet().exists()'

returns false

Is it ok to set "node.name" in elasticsearch.yml for the standalone mode

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/index-not-recognized-from-java-api-tp4032156.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
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.