Package org.elasticsearch.action.search

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


                    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

            assertThat(facet.entries().get(1).totalCount(), equalTo(1l));
            assertThat(facet.entries().get(1).min(), closeTo(500d, 0.00001d));
            assertThat(facet.entries().get(1).max(), closeTo(500d, 0.00001d));
            assertThat(facet.entries().get(1).total(), closeTo(500d, 0.00001d));

            facet = searchResponse.facets().facet("stats2");
            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).min(), closeTo(1d, 0.00001d));
            assertThat(facet.entries().get(0).max(), closeTo(3d, 0.00001d));
View Full Code Here

            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).min(), closeTo(5d, 0.00001d));
            assertThat(facet.entries().get(1).max(), closeTo(6d, 0.00001d));
            assertThat(facet.entries().get(1).total(), closeTo(11d, 0.00001d));

            facet = searchResponse.facets().facet("stats3");
            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).total(), closeTo(300d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(300d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).total(), closeTo(500d, 0.00001d));

            facet = searchResponse.facets().facet("stats4");
            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).total(), closeTo(8d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(8d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).total(), closeTo(11d, 0.00001d));

            facet = searchResponse.facets().facet("stats5");
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).term(), equalTo("yyy"));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).total(), closeTo(500d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("xxx"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(500d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("xxx"));
            assertThat(facet.entries().get(1).count(), equalTo(2l));
            assertThat(facet.entries().get(1).total(), closeTo(300d, 0.00001d));

            facet = searchResponse.facets().facet("stats6");
            assertThat(facet.entries().size(), equalTo(2));
            assertThat(facet.entries().get(0).term(), equalTo("yyy"));
            assertThat(facet.entries().get(0).count(), equalTo(1l));
            assertThat(facet.entries().get(0).total(), closeTo(11d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("xxx"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(11d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("xxx"));
            assertThat(facet.entries().get(1).count(), equalTo(2l));
            assertThat(facet.entries().get(1).total(), closeTo(8d, 0.00001d));

            facet = searchResponse.facets().facet("stats7");
            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).total(), closeTo(300d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(300d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).total(), closeTo(500d, 0.00001d));

            facet = searchResponse.facets().facet("stats8");
            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).total(), closeTo(8d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
View Full Code Here

            assertThat(facet.entries().get(0).total(), closeTo(8d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
            assertThat(facet.entries().get(1).count(), equalTo(1l));
            assertThat(facet.entries().get(1).total(), closeTo(11d, 0.00001d));

            facet = searchResponse.facets().facet("stats9");
            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).total(), closeTo(300d, 0.00001d));
            assertThat(facet.entries().get(1).term(), equalTo("yyy"));
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.