Re: Index missing error Eelasticseach java

2014-07-03 Thread venuchitta
Thank You for your help.



--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/Index-missing-error-Eelasticseach-java-tp4059080p4059181.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1404343423524-4059181.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Index missing error Eelasticseach java

2014-07-02 Thread venuchitta
Hi,

I am new to elasticsearch. I am using JAVA Api to establish connection
with ES.

public void createIndex(final String index) {

getClient().admin().indices().prepareCreate(index).execute().actionGet();
}


public void createLocalCluster(final String clusterName) {
NodeBuilder builder = NodeBuilder.nodeBuilder();
Settings settings = ImmutableSettings.settingsBuilder()
.put("gateway.type", "none")
.put("cluster.name", clusterName)
.build();
builder.settings(settings).local(false).data(true);
this.node = builder.node();
this.client = node.client();
}

public boolean existsIndex(final String index) {
IndicesExistsResponse response =
getClient().admin().indices().prepareExists(index).execute().actionGet();
return response.isExists(); 
}

public void openIndex(String name){

getClient().admin().indices().prepareOpen(name).execute().actionGet();
}

createLocalCluster("cerES");
createIndex("news");
System.out.println(existsIndex("news"));

When i execute the above java code iam getting "true" response. But when i
close the java program and start the program again with the following code:
openIndex("news");

It is throwing IndexMissingException.But i can see the news index in Data
folder of eclipse. So how i retreive data from the node previously?. Is it
lost? or am i wrong somewhere?





--
View this message in context: 
http://elasticsearch-users.115913.n3.nabble.com/Index-missing-error-Eelasticseach-java-tp4059080.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1404254107251-4059080.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.