Beispiel #1
0
  @Override
  public AbstractFacetBuilder fromFacetField(String ff, int limit) {
    AbstractFacetBuilder facetBuilder;
    if (ff.equals(ElasticTweetSearch.FIRST_URL_TITLE) || ff.equals(ElasticTweetSearch.TAG)) {
      // hmmh no real differences ... strange
      facetBuilder =
          FacetBuilders.termsStats(ff)
              .keyField(ff)
              .valueScript("doc.score")
              .order(ComparatorType.TOTAL)
              .size(limit);
      //                    fb =
      // FacetBuilders.termsStats(ff).keyField(ff).valueScript("doc.relevance.value").order(ComparatorType.TOTAL);//.size(15);
      //                    fb =
      // FacetBuilders.termsStats(ff).keyField(ff).valueScript("doc.relevance.value").order(ComparatorType.COUNT).size(15);
    } else facetBuilder = super.fromFacetField(ff, limit);

    if (dateFilter != null) facetBuilder.facetFilter(dateFilter);

    return facetBuilder;
  }
 /** Marks the facet to run in a specific scope. */
 @Override
 public RangeScriptFacetBuilder scope(String scope) {
   super.scope(scope);
   return this;
 }
 /**
  * Should the facet run in global mode (not bounded by the search query) or not (bounded by the
  * search query). Defaults to <tt>false</tt>.
  */
 public RangeScriptFacetBuilder global(boolean global) {
   super.global(global);
   return this;
 }
Beispiel #4
0
 @Override
 public AbstractFacetBuilder fromFacetQuery(StrEntry e) {
   AbstractFacetBuilder facetBuilder = super.fromFacetQuery(e);
   if (dateFilter != null) facetBuilder.facetFilter(dateFilter);
   return facetBuilder;
 }