Package org.elasticsearch.action.percolate

Examples of org.elasticsearch.action.percolate.PercolateResponse.matches()


        System.out.println("Percolating [" + COUNT + "] ...");
        int i = 1;
        for (; i <= COUNT; i++) {
            PercolateResponse percolate = client1.preparePercolate("test", "type1").setSource(source(Integer.toString(i), "value"))
                    .execute().actionGet();
            if (percolate.matches().size() != QUERIES) {
                System.err.println("No matching number of queries");
            }
            if ((i % 10000) == 0) {
                System.out.println("Percolated " + i + " took " + stopWatch.stop().lastTaskTime());
                stopWatch.start();
View Full Code Here


        PercolateResponse percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));

        client.close();
        closeNode("node1");

        startNode("node1", settingsBuilder().put("gateway.type", "local").build());
View Full Code Here

        percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));
    }

    @Test public void testRestartNodePercolator2() throws Exception {
        logger.info("--> cleaning nodes");
        buildNode("node1", settingsBuilder().put("gateway.type", "local"));
View Full Code Here

        PercolateResponse percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));

        client.close();
        closeNode("node1");

        startNode("node1", settingsBuilder().put("gateway.type", "local").build());
View Full Code Here

        percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(0));

        logger.info("--> register a query");
        client.prepareIndex("_percolator", "test", "kuku")
                .setSource(jsonBuilder().startObject()
                        .field("color", "blue")
View Full Code Here

        percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));
    }
}
View Full Code Here

        PercolateResponse percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                .field("field1", "value1")
                .endObject().endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));

        percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject()
                .startObject("doc").field("field1", "value1").endObject()
                .field("query", matchAllQuery())
                .endObject())
View Full Code Here

        percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject()
                .startObject("doc").field("field1", "value1").endObject()
                .field("query", matchAllQuery())
                .endObject())
                .execute().actionGet();
        assertThat(percolate.matches().size(), equalTo(1));
    }

    @Test public void createIndexAndThenRegisterPercolator() throws Exception {
        try {
            client.admin().indices().prepareDelete("test").execute().actionGet();
View Full Code Here

        for (int i = 0; i < 10; i++) {
            PercolateResponse percolate = client.preparePercolate("test", "type1").setSource(jsonBuilder().startObject().startObject("doc")
                    .field("field1", "value1")
                    .endObject().endObject())
                    .execute().actionGet();
            assertThat(percolate.matches().size(), equalTo(1));
        }

        for (int i = 0; i < 10; i++) {
            PercolateResponse percolate = client.preparePercolate("test", "type1").setPreferLocal(false).setSource(jsonBuilder().startObject().startObject("doc")
                    .field("field1", "value1")
View Full Code Here

        for (int i = 0; i < 10; i++) {
            PercolateResponse percolate = client.preparePercolate("test", "type1").setPreferLocal(false).setSource(jsonBuilder().startObject().startObject("doc")
                    .field("field1", "value1")
                    .endObject().endObject())
                    .execute().actionGet();
            assertThat(percolate.matches().size(), equalTo(1));
        }

        logger.info("--> delete the index");

        try {
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.