Examples of facets()


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

            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("stats10");
            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

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

            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("stats11");
            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

Examples of org.elasticsearch.search.facet.Facets.facets()

        }

        if (rsp != null) {
            Facets facets = rsp.facets();
            if (facets != null)
                for (Facet facet : facets.facets()) {
                    if (facet instanceof TermsFacet) {
                        TermsFacet ff = (TermsFacet) facet;
                        Integer integ = filterToIndex.get(ff.getName());
                        if (integ != null && ff.entries() != null) {
                            List<FacetHelper> list = new ArrayList<FacetHelper>();
View Full Code Here

Examples of org.elasticsearch.search.internal.InternalSearchResponse.facets()

        }

        InternalSearchResponse searchResponse = searchPhaseController.merge(sortedShardList, queryResults, fetchResults);
        assertThat(searchResponse.hits().totalHits(), equalTo(100l));

        assertThat(searchResponse.facets().facet(QueryFacet.class, "test1").count(), equalTo(1l));
        assertThat(searchResponse.facets().facet(QueryFacet.class, "all").count(), equalTo(100l));
    }

    @Test public void testSimpleFacetsTwice() {
        testSimpleFacets();
View Full Code Here

Examples of org.elasticsearch.search.query.QuerySearchResult.facets()

        // merge facets
        InternalFacets facets = null;
        if (!queryResults.isEmpty()) {
            // we rely on the fact that the order of facets is the same on all query results
            if (querySearchResult.facets() != null && querySearchResult.facets().facets() != null && !querySearchResult.facets().facets().isEmpty()) {
                List<Facet> aggregatedFacets = Lists.newArrayList();
                List<Facet> namedFacets = Lists.newArrayList();
                for (Facet facet : querySearchResult.facets()) {
                    // aggregate each facet name into a single list, and aggregate it
                    namedFacets.clear();
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.