Package org.elasticsearch.search.facet.query

Examples of org.elasticsearch.search.facet.query.QueryFacetBuilder


        }
      }

      if (facetQueries != null && !facetQueries.isEmpty()) {
        for (String facetQuery : facetQueries) {
          QueryFacetBuilder queryFacetBuilder = new QueryFacetBuilder(facetQuery);
          queryFacetBuilder.query(QueryBuilders.queryString(facetQuery));
          searchSourceBuilder.facet(queryFacetBuilder);
        }
      }
    }
View Full Code Here


* @author kimchy (shay.banon)
*/
public class FacetBuilders {

    public static QueryFacetBuilder queryFacet(String facetName) {
        return new QueryFacetBuilder(facetName);
    }
View Full Code Here

    public static QueryFacetBuilder queryFacet(String facetName) {
        return new QueryFacetBuilder(facetName);
    }

    public static QueryFacetBuilder queryFacet(String facetName, QueryBuilder query) {
        return new QueryFacetBuilder(facetName).query(query);
    }
View Full Code Here

        }
      }

      if (facetQueries != null && !facetQueries.isEmpty()) {
        for (String facetQuery : facetQueries) {
          QueryFacetBuilder queryFacetBuilder = new QueryFacetBuilder(facetQuery);
          queryFacetBuilder.query(QueryBuilders.queryString(facetQuery));
          searchSourceBuilder.facet(queryFacetBuilder);
        }
      }
    }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/api/search/facets/query-facet.html">documentation</a>
     */
    @Test
    public void queryFacet() throws Exception {
        QueryFacetBuilder facet = FacetBuilders.queryFacet("f",
                QueryBuilders.matchQuery("brand", "heineken"));

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

        f.getCount();   // Number of docs that matched
View Full Code Here

TOP

Related Classes of org.elasticsearch.search.facet.query.QueryFacetBuilder

Copyright © 2018 www.massapicom. 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.