Examples of TermsFacet


Examples of org.elasticsearch.search.facet.terms.TermsFacet

    public void facetFilterOnTermFacet() throws Exception {
        TermsFacetBuilder facet = FacetBuilders.termsFacet("f")
                .field("brand")
                .facetFilter(FilterBuilders.termFilter("colour", "pale"));

        TermsFacet f = (TermsFacet) launchSearch(facet, "f");

        f.getTotalCount();      // Total terms doc count
        f.getOtherCount();      // Not shown terms doc count
        f.getMissingCount();    // Without term doc count

        // For each entry
        for (TermsFacet.Entry entry : f) {
            entry.getTerm();    // Term
            entry.getCount();   // Doc count
View Full Code Here

Examples of org.elasticsearch.search.facet.terms.TermsFacet

        Assert.assertNotNull(sr.getFacets());
        Assert.assertNotNull(sr.getFacets().facetsAsMap().get("f"));
        Assert.assertEquals("f", sr.getFacets().facetsAsMap().get("f").getName());


        TermsFacet f = (TermsFacet) sr.getFacets().facetsAsMap().get("f");

        f.getTotalCount();      // Total terms doc count
        f.getOtherCount();      // Not shown terms doc count
        f.getMissingCount();    // Without term doc count

        // For each entry
        for (TermsFacet.Entry entry : f) {
            entry.getTerm();    // Term
            entry.getCount();   // Doc count
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.