IndexMissingException when creating Client using Java

I am getting IndexMissingExeption all time I try to perform search using Java.

Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [myindex] missing

The Exception is occurred on line, where I do execute() search

        Node node = nodeBuilder().clusterName("myname").node();
        Client client = node.client();

        SearchResponse scrollResp = client.prepareSearch("myindex", "mytype")
                .setScroll(new TimeValue(60000)).setSize(10)

Index name/cluster name is correct. Index is working, I can perform any operation with index using Curl. Is there something I am missing?

Node node = nodeBuilder().clusterName("myname").node();

I think you are using may be an old elasticsearch version. FWIW you can not embed elasticsearch like this anymore.
Which makes me think here that you just created a Node running locally which does not have any index created.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.