# Index not recognized from java api

**URL:** <https://discuss.elastic.co/t/index-not-recognized-from-java-api/11258>\
**Category:** Elasticsearch\
**Created:** [March 22, 2013, 7:24am UTC](https://discuss.elastic.co/t/index-not-recognized-from-java-api/11258 "2013-03-22T07:24:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chetana](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@Chetana](https://discuss.elastic.co/u/Chetana)\
**Post date:** [March 22, 2013, 7:24am UTC](https://discuss.elastic.co/t/index-not-recognized-from-java-api/11258/1 "2013-03-22T07:24:51Z")

</div>

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/](http://localhost:9200/test/)''. I could also see empty mapping for '''test' when I run curl -XGET [http://localhost:9200/\_mapping](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

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [March 25, 2013, 10:07pm UTC](https://discuss.elastic.co/t/index-not-recognized-from-java-api/11258/2 "2013-03-25T22:07:04Z")

</div>

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/](http://localhost:9200/test/)''. I could also see empty mapping for  
> '''test'  
> when I run curl -XGET [http://localhost:9200/\_mapping](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](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](http://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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:44am UTC](https://discuss.elastic.co/t/index-not-recognized-from-java-api/11258/3 "2017-07-06T02:44:33Z")

</div>


