Package org.elasticsearch.client

Examples of org.elasticsearch.client.Client.admin()


        Assert.assertNotNull(Proxy.getInvocationHandler(node));
        Client client = checkClient("testNodeClient");
        Assert.assertNotNull(Proxy.getInvocationHandler(client));

        checkClient("testNodeClient");
        client.admin().cluster().prepareState().execute().get();
    }
}
View Full Code Here


  public void test_update_settings() {
        Client client = checkClient("esClient");
        checkClient("esClient2");

        // We test how many shards and replica we have
        ClusterStateResponse response = client.admin().cluster().prepareState().execute().actionGet();
        assertThat(response.getState().getMetaData().getIndices().get("twitter").getNumberOfShards(), is(1));
        assertThat(response.getState().getMetaData().getIndices().get("twitter").getNumberOfReplicas(), is(1));
    }
}
View Full Code Here

            throw new Exception("Must not be proxyfied");
        } catch (IllegalArgumentException e) {
        }

        Client client = checkClient(true);
        client.admin().cluster().prepareState().execute().get();
    }
}
View Full Code Here

  public void test_settings_are_not_updated() {
        Client client = checkClient("esClient");
        checkClient("esClient2");

        // We test how many shards and replica we have
        ClusterStateResponse response = client.admin().cluster().prepareState().execute().actionGet();
        assertThat(response.getState().getMetaData().getIndices().get("twitter").getNumberOfShards(), is(1));
        assertThat(response.getState().getMetaData().getIndices().get("twitter").getNumberOfReplicas(), is(0));
    }
}
View Full Code Here

  @Test
  public void test_settings_without_mapping() {
    Client client = checkClient();

    // We should have an existing index here
        IndicesExistsResponse ier = client.admin().indices().prepareExists("twitter").execute().actionGet();
        assertThat(ier.isExists(), is(true));
    }
}
View Full Code Here

    @Test
    public void test_node_client() throws Exception {
        checkNode(true);

        Client client = checkClient(false);
        client.admin().cluster().prepareState().execute().get();
    }
}
View Full Code Here

     */
    @Test
    public void testExternalVersion() {
        Client client = esSetup.client();
        deleteIndex("test");
        client.admin().indices().prepareCreate("test").execute().actionGet();
        client.admin().cluster().prepareHealth("test").setWaitForGreenStatus().execute().actionGet();

        client.prepareIndex("test", "type", "1").setSource("field1", "value1_1").setVersion(
                0).setVersionType(VersionType.EXTERNAL).execute().actionGet();
        client.admin().indices().prepareRefresh().execute().actionGet();
View Full Code Here

    @Test
    public void testExternalVersion() {
        Client client = esSetup.client();
        deleteIndex("test");
        client.admin().indices().prepareCreate("test").execute().actionGet();
        client.admin().cluster().prepareHealth("test").setWaitForGreenStatus().execute().actionGet();

        client.prepareIndex("test", "type", "1").setSource("field1", "value1_1").setVersion(
                0).setVersionType(VersionType.EXTERNAL).execute().actionGet();
        client.admin().indices().prepareRefresh().execute().actionGet();
View Full Code Here

        client.admin().indices().prepareCreate("test").execute().actionGet();
        client.admin().cluster().prepareHealth("test").setWaitForGreenStatus().execute().actionGet();

        client.prepareIndex("test", "type", "1").setSource("field1", "value1_1").setVersion(
                0).setVersionType(VersionType.EXTERNAL).execute().actionGet();
        client.admin().indices().prepareRefresh().execute().actionGet();

        ExportResponse response = executeExportRequest(
                "{\"output_cmd\": \"cat\", \"fields\": [\"_id\", \"_version\", \"_source\"]}");

        List<Map<String, Object>> infos = getExports(response);
View Full Code Here

                fromClassPath("essetup/settings/test_a.json")).withMapping("d",
                        "{\"d\": {\"_timestamp\": {\"enabled\": true, \"store\": \"yes\"}}}"));
        Client client = esSetup.client();
        client.prepareIndex("tsstored", "d", "1").setSource(
                "field1", "value1").setTimestamp("123").execute().actionGet();
        client.admin().indices().prepareRefresh().execute().actionGet();

        ExportResponse response = executeExportRequest(
                "{\"output_cmd\": \"cat\", \"fields\": [\"_id\", \"_timestamp\"]}");

        List<Map<String, Object>> infos = getExports(response);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.