Пример #1
0
 // ===================================================================================
 //                                                                               Build
 //                                                                               =====
 @Override
 public CountRequestBuilder build(CountRequestBuilder builder) {
   if (_conditionQuery != null) {
     QueryBuilder queryBuilder = _conditionQuery.getQuery();
     if (queryBuilder != null) {
       builder.setQuery(queryBuilder);
     }
   }
   return builder;
 }
Пример #2
0
  @Override
  public SearchRequestBuilder build(SearchRequestBuilder builder) {
    if (_conditionQuery != null) {
      QueryBuilder queryBuilder = _conditionQuery.getQuery();
      if (queryBuilder != null) {
        builder.setQuery(queryBuilder);
      }
      _conditionQuery
          .getFieldSortBuilderList()
          .forEach(
              sort -> {
                builder.addSort(sort);
              });
    }

    if (_specification != null) {
      builder.setFetchSource(
          _specification.columnList.toArray(new String[_specification.columnList.size()]), null);
    }

    return builder;
  }