Package com.pearson.entech.elasticsearch.search.facet.approx.date.external

Examples of com.pearson.entech.elasticsearch.search.facet.approx.date.external.DateFacetBuilder


                _checker = buildChecker();
            return _checker;
        }

        protected DateFacetBuilder makeFacet(final String name) {
            return new DateFacetBuilder(name)
                    .interval(randomPick(_intervals))
                    .keyField(_dtField);
        }
View Full Code Here


        client().admin().indices().prepareRefresh().execute().actionGet();

        final SearchResponse searchResponse = client()
                .prepareSearch()
                .setQuery(matchAllQuery())
                .addFacet(new DateFacetBuilder("stats1").keyField("date").distinctField("num").interval("day").mode(mode))
                .addFacet(new DateFacetBuilder("stats2").keyField("date").distinctField("num").interval("day").preZone("-02:00").mode(mode))
                .addFacet(new DateFacetBuilder("stats3").keyField("date").distinctField("num").interval("day").preZone("-02:00").mode(mode))
                //                .addFacet(
                //                        new DateFacetBuilder("stats4").keyField("date").distinctScript("doc['num'].distinct * 2").interval("day").preZone("-02:00")
                //                                .mode(mode))
                .addFacet(new DateFacetBuilder("stats5").keyField("date").distinctField("num").interval("24h").mode(mode))
                .addFacet(
                        new DateFacetBuilder("stats6").keyField("date").distinctField("num").interval("day").preZone("-02:00").postZone("-02:00")
                                .mode(mode))
                .addFacet(new DateFacetBuilder("stats7").keyField("date").distinctField("num").interval("quarter").mode(mode))
                .execute().actionGet();

        if(searchResponse.getFailedShards() > 0) {
            System.out.println(searchResponse);
            fail(Joiner.on(", ").join(searchResponse.getShardFailures()));
View Full Code Here

                .endObject()).execute().actionGet();
        client().admin().indices().prepareRefresh().execute().actionGet();

        final SearchResponse searchResponse = client().prepareSearch()
                .setQuery(matchAllQuery())
                .addFacet(new DateFacetBuilder("stats1").keyField("date").distinctField("num").interval("day").preZone("+02:00"))
                .addFacet(new DateFacetBuilder("stats2").keyField("date").distinctField("num").interval("day").preZone("+01:30"))
                .execute().actionGet();

        if(searchResponse.getFailedShards() > 0) {
            System.out.println(searchResponse);
            fail(Joiner.on(", ").join(searchResponse.getShardFailures()));
View Full Code Here

    private SearchResponse getHistogram(final long start, final long end, final String interval, final String distinctField, final int exactThreshold) {
        final FilterBuilder range =
                FilterBuilders.numericRangeFilter(__tsField)
                        .from(start)
                        .to(end);
        final DateFacetBuilder facet =
                new DateFacetBuilder(__facetName)
                        .keyField(__tsField)
                        .distinctField(distinctField)
                        .facetFilter(range)
                        .exactThreshold(exactThreshold)
                        .interval(interval);
View Full Code Here

TOP

Related Classes of com.pearson.entech.elasticsearch.search.facet.approx.date.external.DateFacetBuilder

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.