IndexMissingException with NodeClient

Hello,

I set up ES and am able to index entries using curl, as mentioned here:

I'm now trying to set up a Java client. For some reason, if I use a
TransportClient, I am able to properly get entries from ES. However, when I
use NodeClient, I'm getting an IndexMissingException (stack trace below).

The gist of the code is here:

If I change line 22 to getTransportClient, everything's peachy. Any
suggestions on what I need to do to get the NodeClient working?

I am on Windows7, and started bin/elasticsearch.bat using the default
elasticsearch.yml configuration.

Thanks,
Raj


Exception in thread "main" org.elasticsearch.indices.IndexMissingException:
[twitter] missing
at
org.elasticsearch.cluster.metadata.MetaData.concreteIndex(MetaData.java:532)
at
org.elasticsearch.action.get.TransportGetAction.resolveRequest(TransportGetAction.java:90)
at
org.elasticsearch.action.get.TransportGetAction.resolveRequest(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:115)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:95)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:72)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:47)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:83)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:171)
at
org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:135)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:53)
at
org.elasticsearch.action.support.BaseRequestBuilder.execute(BaseRequestBuilder.java:47)
at ESTest.main(ESTest.java:26)