I need to check if any index already exist or not or re-start or start up the ES Data node.
I am facing issue if I restart the ES Data node and then directly check if an index exist or not. I am always getting response as "false" (even if it exist and a valid one). But if, I perform a search or any other operation on that index and then again check "is index exist" then I am correctly getting "true" as response. Could you guide me what I might be missing or doing wrong. I am using the Java client API and using following code snippet for it:- *1- to start the data node :-* defaultSettingsFile = new FileInputStream(ElasticSearchConfig.modulesDir + "/" + ElasticSearchConfig.ES_DEFAULT_PROP); settingsBuilder.loadFromStream(ElasticSearchConfig.ES_DEFAULT_PROP, defaultSettingsFile); // override the default properties settingsFile = new FileInputStream(ElasticSearchConfig.modulesDir + "/" + ElasticSearchConfig.ES_OVERRIDE_PROP); settingsBuilder.loadFromStream(ElasticSearchConfig.ES_OVERRIDE_PROP, settingsFile); Settings finalSettings = settingsBuilder .put(ElasticSearchReservedWords.CLUSTER_NAME.getText(), ElasticSearchConfig.clusterName) .put(ElasticSearchReservedWords.NODE_NAME.getText(), ElasticSearchConfig.esDataNodeProperty.getName()) .put(ElasticSearchReservedWords.NODE_MASTER.getText(), true) .put(ElasticSearchReservedWords.NODE_DATA.getText(), true) .put(ElasticSearchReservedWords.PATH_DATA.getText(), ElasticSearchConfig.esDataNodeProperty.getDataPath()) .put("discovery.zen.ping.multicast.enabled", false) .put("discovery.zen.ping.unicast.hosts", ElasticSearchConfig.unicast_hosts) // // NetworkUtils.getLocalAddress().getHostName() .put("indices.store.type", "mmapfs") .put("index.number_of_shards", ElasticSearchConfig.numberOfShards) .build(); node = nodeBuilder().settings(finalSettings).node(); node.start(); *2- To check if Index exist :-* IndicesExistsRequest request = new IndicesExistsRequest(indexName); IndicesExistsResponse response = getClientAdminNode().indices().exists(request).actionGet(); Thanks Gaurav -- 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/CALZAj3%2BvKH2s3Mwg%3DbmhF1idbUrXAfB9ic48o6J9rXF1MZ%2BZvA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.