I have code that stores items in a dated index on a test elasticsearch server. When the cluster name is set to the default "elasticsearch" items go in and can be retrieved fine.
Today I tried switching the cluster name to the server to elasticsearch-staging. I adjusted the "cluster.name" Java TransportClient value in the calling code that sets up a shared client. With this change Elasticsearch created new indexes along with the change in cluster name. This is fine, as the system is for testing purposes.
Items are stored fine into the new index by calling client code but searches return no results. Code is able to verify the existence of the index prior to search but the search still returns no results.
Here is some calling code that is no longer working
final AndFilterBuilder afb = new AndFilterBuilder(); afb.add(FilterBuilders.termFilter("document.file-path", path)); response = transportClient.prepareSearch(index) .setTypes("document") .setPostFilter(afb) .execute() .get();
Using elasticsearch 1.5.2 from the Elasticsearch debian distribution