Examples of client()


Examples of org.elasticsearch.node.Node.client()

        } catch (Exception e) {
            // ignore
        }

        for (int i = 0; i < 20; i++) {
            node.client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", 10)).execute().actionGet();

            node.client().prepareIndex("test", "type1").setSource("field", "test").execute().actionGet();
            node.client().admin().indices().prepareRefresh().execute().actionGet();

            SearchResponse searchResponse = node.client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

        }

        for (int i = 0; i < 20; i++) {
            node.client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", 10)).execute().actionGet();

            node.client().prepareIndex("test", "type1").setSource("field", "test").execute().actionGet();
            node.client().admin().indices().prepareRefresh().execute().actionGet();

            SearchResponse searchResponse = node.client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
            assertThat(searchResponse.hits().totalHits(), equalTo(1l));
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

        for (int i = 0; i < 20; i++) {
            node.client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", 10)).execute().actionGet();

            node.client().prepareIndex("test", "type1").setSource("field", "test").execute().actionGet();
            node.client().admin().indices().prepareRefresh().execute().actionGet();

            SearchResponse searchResponse = node.client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
            assertThat(searchResponse.hits().totalHits(), equalTo(1l));

            node.client().admin().indices().prepareDelete("test").execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

            node.client().admin().indices().prepareCreate("test").setSettings(settingsBuilder().put("number_of_shards", 10)).execute().actionGet();

            node.client().prepareIndex("test", "type1").setSource("field", "test").execute().actionGet();
            node.client().admin().indices().prepareRefresh().execute().actionGet();

            SearchResponse searchResponse = node.client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
            assertThat(searchResponse.hits().totalHits(), equalTo(1l));

            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        }
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

            node.client().admin().indices().prepareRefresh().execute().actionGet();

            SearchResponse searchResponse = node.client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
            assertThat(searchResponse.hits().totalHits(), equalTo(1l));

            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        }

        try {
            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        } catch (Exception e) {
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        }

        try {
            node.client().admin().indices().prepareDelete("test").execute().actionGet();
        } catch (Exception e) {
            // ignore
        }
    }
}
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

    }

    @Test public void testHealth() {
        Node node1 = startNode("node1");
        logger.info("--> running cluster health on an index that does not exists");
        ClusterHealthResponse healthResponse = node1.client().admin().cluster().prepareHealth("test").setWaitForYellowStatus().setTimeout("1s").execute().actionGet();
        assertThat(healthResponse.timedOut(), equalTo(true));
        assertThat(healthResponse.status(), equalTo(ClusterHealthStatus.RED));
    }
}
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

    @Test public void testX() throws Exception {
        buildNode("node1", settingsBuilder().put("gateway.type", "local").build());
        cleanAndCloseNodes();

        Node node1 = startNode("node1", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 1).build());
        node1.client().prepareIndex("test", "type1", "10990239").setSource(jsonBuilder().startObject()
                .field("_id", "10990239")
                .startArray("appAccountIds").value(14).value(179).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990473").setSource(jsonBuilder().startObject()
                .field("_id", "10990473")
                .startArray("appAccountIds").value(14).endArray().endObject()).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

        Node node1 = startNode("node1", settingsBuilder().put("gateway.type", "local").put("index.number_of_shards", 1).build());
        node1.client().prepareIndex("test", "type1", "10990239").setSource(jsonBuilder().startObject()
                .field("_id", "10990239")
                .startArray("appAccountIds").value(14).value(179).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990473").setSource(jsonBuilder().startObject()
                .field("_id", "10990473")
                .startArray("appAccountIds").value(14).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990513").setSource(jsonBuilder().startObject()
                .field("_id", "10990513")
                .startArray("appAccountIds").value(14).value(179).endArray().endObject()).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.node.Node.client()

                .field("_id", "10990239")
                .startArray("appAccountIds").value(14).value(179).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990473").setSource(jsonBuilder().startObject()
                .field("_id", "10990473")
                .startArray("appAccountIds").value(14).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990513").setSource(jsonBuilder().startObject()
                .field("_id", "10990513")
                .startArray("appAccountIds").value(14).value(179).endArray().endObject()).execute().actionGet();
        node1.client().prepareIndex("test", "type1", "10990695").setSource(jsonBuilder().startObject()
                .field("_id", "10990695")
                .startArray("appAccountIds").value(14).endArray().endObject()).execute().actionGet();
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.