Package org.elasticsearch.action.search

Examples of org.elasticsearch.action.search.SearchResponse.facets()


                        .addUnboundedTo(1)
                )
                .execute().actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(7l));
        GeoDistanceFacet facet = searchResponse.facets().facet("geo1");
        assertThat(facet.entries().size(), equalTo(4));

        assertThat(facet.entries().get(0).to(), closeTo(2, 0.000001));
        assertThat(facet.entries().get(0).count(), equalTo(4l));
        assertThat(facet.entries().get(0).total(), not(closeTo(0, 0.00001)));
View Full Code Here


                        .addUnboundedTo(1)
                )
                .execute().actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(7l));
        facet = searchResponse.facets().facet("geo1");
        assertThat(facet.entries().size(), equalTo(4));

        assertThat(facet.entries().get(0).to(), closeTo(2, 0.000001));
        assertThat(facet.entries().get(0).count(), equalTo(4l));
        assertThat(facet.entries().get(0).total(), closeTo(13, 0.00001));
View Full Code Here

                        .addUnboundedTo(1)
                )
                .execute().actionGet();

        assertThat(searchResponse.hits().totalHits(), equalTo(7l));
        facet = searchResponse.facets().facet("geo1");
        assertThat(facet.entries().size(), equalTo(4));

        assertThat(facet.entries().get(0).to(), closeTo(2, 0.000001));
        assertThat(facet.entries().get(0).count(), equalTo(4l));
        assertThat(facet.entries().get(0).total(), closeTo(13, 0.00001));
View Full Code Here

                .execute().actionGet();

        assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0));

        assertThat(searchResponse.hits().totalHits(), equalTo(2l));
        GeoDistanceFacet facet = searchResponse.facets().facet("geo1");
        assertThat(facet.entries().size(), equalTo(2));

        assertThat(facet.entries().get(0).from(), closeTo(0, 0.000001));
        assertThat(facet.entries().get(0).to(), closeTo(2, 0.000001));
        assertThat(facet.entries().get(0).count(), equalTo(2l));
View Full Code Here

                .execute().actionGet();

        assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0));
        assertThat(searchResponse.hits().totalHits(), equalTo(2l));

        TermsStatsFacet termsStatsFacet = searchResponse.facets().facet("facet1");
        assertThat(termsStatsFacet.entries().size(), equalTo(4));
        assertThat(termsStatsFacet.entries().get(0).term(), equalTo("blue"));
        assertThat(termsStatsFacet.entries().get(0).count(), equalTo(3l));
        assertThat(termsStatsFacet.entries().get(0).total(), equalTo(8d));
        assertThat(termsStatsFacet.entries().get(1).term(), equalTo("yellow"));
View Full Code Here

                .execute().actionGet();

        assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0));
        assertThat(searchResponse.hits().totalHits(), equalTo(2l));

        termsStatsFacet = searchResponse.facets().facet("facet1");
        assertThat(termsStatsFacet.entries().size(), equalTo(1));
        assertThat(termsStatsFacet.entries().get(0).term(), equalTo("blue"));
        assertThat(termsStatsFacet.entries().get(0).count(), equalTo(3l));
        assertThat(termsStatsFacet.entries().get(0).total(), equalTo(8d));
    }
View Full Code Here

            }
            assertThat(searchResponse.failedShards(), equalTo(0));

            HistogramFacet facet;

            facet = searchResponse.facets().facet("stats1");
            assertThat(facet.name(), equalTo("stats1"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).key(), equalTo(1000l));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).min(), closeTo(1055d, 0.000001));
View Full Code Here

            assertThat(facet.entries().get(1).max(), closeTo(1175d, 0.000001));
            assertThat(facet.entries().get(1).totalCount(), equalTo(1l));
            assertThat(facet.entries().get(1).total(), equalTo(1175d));
            assertThat(facet.entries().get(1).mean(), equalTo(1175d));

            facet = searchResponse.facets().facet("stats2");
            assertThat(facet.name(), equalTo("stats2"));
            assertThat(facet.entries().size(), equalTo(3));
            assertThat(facet.entries().get(0).key(), equalTo(10l));
            assertThat(facet.entries().get(0).count(), equalTo(3l));
            assertThat(facet.entries().get(0).totalCount(), equalTo(3l));
View Full Code Here

            assertThat(facet.entries().get(2).count(), equalTo(1l));
            assertThat(facet.entries().get(2).totalCount(), equalTo(1l));
            assertThat(facet.entries().get(2).total(), equalTo(31d));
            assertThat(facet.entries().get(2).mean(), equalTo(31d));

            facet = searchResponse.facets().facet("stats3");
            assertThat(facet.name(), equalTo("stats3"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).key(), equalTo(1000l));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).totalCount(), equalTo(4l));
View Full Code Here

            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).totalCount(), equalTo(2l));
            assertThat(facet.entries().get(1).total(), equalTo(42d));
            assertThat(facet.entries().get(1).mean(), equalTo(21d));

            facet = searchResponse.facets().facet("stats4");
            assertThat(facet.name(), equalTo("stats4"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).key(), equalTo(0l));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).totalCount(), equalTo(2l));
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.