Package org.elasticsearch.search.facet.histogram

Examples of org.elasticsearch.search.facet.histogram.HistogramFacetBuilder


    public static StatisticalScriptFacetBuilder statisticalScriptFacet(String facetName) {
        return new StatisticalScriptFacetBuilder(facetName);
    }

    public static HistogramFacetBuilder histogramFacet(String facetName) {
        return new HistogramFacetBuilder(facetName);
    }
View Full Code Here


  public FacetBuilder getFacet() {
    Assert.notNull(getName(), "Facet name can't be a null !!!");
    Assert.isTrue(StringUtils.isNotBlank(field), "Please select field on which to build the facet !!!");
    Assert.isTrue(interval > 0, "Please provide interval as positive value greater them zero !!!");

    HistogramFacetBuilder builder = FacetBuilders.histogramFacet(getName());
    builder.field(field);

    if (timeUnit != null) {
      builder.interval(interval, timeUnit);
    } else {
      builder.interval(interval);
    }

    return builder;
  }
View Full Code Here

     * @throws Exception
     * <br>See <a href="http://www.elasticsearch.org/guide/reference/api/search/facets/histogram-facet.html">documentation</a>
     */
    @Test
    public void histogramFacet() throws Exception {
        HistogramFacetBuilder facet = FacetBuilders.histogramFacet("f")
                .field("price")
                .interval(1);

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

View Full Code Here

TOP

Related Classes of org.elasticsearch.search.facet.histogram.HistogramFacetBuilder

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.