Examples of facets()


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

            assertThat(facet.entries().get(1).total(), closeTo(3, 0.000001));
            assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
            assertThat(facet.entries().get(2).count(), equalTo(1l));
            assertThat(facet.entries().get(2).total(), closeTo(3, 0.000001));

            facet = searchResponse.facets().facet("range3");
            assertThat(facet.name(), equalTo("range3"));
            assertThat(facet.entries().size(), equalTo(3));
            assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).totalCount(), equalTo(2l));
View Full Code Here

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

            assertThat(facet.entries().get(2).totalCount(), equalTo(2l));
            assertThat(facet.entries().get(2).total(), closeTo(61, 0.000001));
            assertThat(facet.entries().get(2).min(), closeTo(30, 0.000001));
            assertThat(facet.entries().get(2).max(), closeTo(31, 0.000001));

            facet = searchResponse.facets().facet("range4");
            assertThat(facet.name(), equalTo("range4"));
            assertThat(facet.entries().size(), equalTo(3));
            assertThat(facet.entries().get(0).to(), closeTo(16, 0.000001));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).total(), closeTo(3, 0.000001));
View Full Code Here

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

            assertThat(facet.entries().get(1).total(), closeTo(1 + 2 + 3, 0.000001));
            assertThat(facet.entries().get(2).from(), closeTo(20, 0.000001));
            assertThat(facet.entries().get(2).count(), equalTo(3l));
            assertThat(facet.entries().get(2).total(), closeTo(1 + 2 + 3, 0.000001));

            facet = searchResponse.facets().facet("range5");
            assertThat(facet.name(), equalTo("range5"));
            assertThat(facet.entries().size(), equalTo(3));
            assertThat(facet.entries().get(0).to(), closeTo(1056, 0.000001));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).total(), closeTo(1, 0.000001));
View Full Code Here

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

            assertThat(facet.entries().get(1).total(), closeTo(3, 0.000001));
            assertThat(facet.entries().get(2).from(), closeTo(1170, 0.000001));
            assertThat(facet.entries().get(2).count(), equalTo(1l));
            assertThat(facet.entries().get(2).total(), closeTo(3, 0.000001));

            facet = searchResponse.facets().facet("range6");
            assertThat(facet.name(), equalTo("range6"));
            assertThat(facet.entries().size(), equalTo(3));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).toAsString(), equalTo("1970-01-01T00:00:26"));
            assertThat(facet.entries().get(1).count(), equalTo(2l));
View Full Code Here

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

                    logger.warn("-> {}", shardSearchFailure);
                }
            }
            assertThat(searchResponse.failedShards(), equalTo(0));

            DateHistogramFacet facet = searchResponse.facets().facet("stats1");
            assertThat(facet.name(), equalTo("stats1"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).time(), equalTo(utcTimeInMillis("2009-03-05")));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(1).time(), equalTo(utcTimeInMillis("2009-03-06")));
View Full Code Here

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

            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(1).time(), equalTo(utcTimeInMillis("2009-03-06")));
            assertThat(facet.entries().get(1).count(), equalTo(1l));

            // time zone causes the dates to shift by 2
            facet = searchResponse.facets().facet("stats2");
            assertThat(facet.name(), equalTo("stats2"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).time(), equalTo(timeInMillis("2009-03-04", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(1).time(), equalTo(timeInMillis("2009-03-05", DateTimeZone.forOffsetHours(-2))));
View Full Code Here

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

            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(1).time(), equalTo(timeInMillis("2009-03-05", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(1).count(), equalTo(2l));

            // time zone causes the dates to shift by 2
            facet = searchResponse.facets().facet("stats3");
            assertThat(facet.name(), equalTo("stats3"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).time(), equalTo(timeInMillis("2009-03-04", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).total(), equalTo(1d));
View Full Code Here

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

            assertThat(facet.entries().get(1).time(), equalTo(timeInMillis("2009-03-05", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(1).count(), equalTo(2l));
            assertThat(facet.entries().get(1).total(), equalTo(5d));

            // time zone causes the dates to shift by 2
            facet = searchResponse.facets().facet("stats4");
            assertThat(facet.name(), equalTo("stats4"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).time(), equalTo(timeInMillis("2009-03-04", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).total(), equalTo(2d));
View Full Code Here

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

            assertThat(facet.entries().get(0).total(), equalTo(2d));
            assertThat(facet.entries().get(1).time(), equalTo(timeInMillis("2009-03-05", DateTimeZone.forOffsetHours(-2))));
            assertThat(facet.entries().get(1).count(), equalTo(2l));
            assertThat(facet.entries().get(1).total(), equalTo(10d));

            facet = searchResponse.facets().facet("stats5");
            assertThat(facet.name(), equalTo("stats5"));
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).time(), equalTo(utcTimeInMillis("2009-03-05")));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(1).time(), equalTo(utcTimeInMillis("2009-03-06")));
View Full Code Here

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

                    logger.warn("-> {}", shardSearchFailure);
                }
            }
            assertThat(searchResponse.failedShards(), equalTo(0));

            TermsStatsFacet facet = searchResponse.facets().facet("stats1");
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).term(), equalTo("xxx"));
            assertThat(facet.entries().get(0).count(), equalTo(2l));
            assertThat(facet.entries().get(0).totalCount(), equalTo(2l));
            assertThat(facet.entries().get(0).min(), closeTo(100d, 0.00001d));
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.