protected virtual AggregationRequest GetRangeFilterValueAggregationRequest(string fieldName, RangeFilterValue value, IEnumerable <IFilter> existingFilters) { var valueFilter = FiltersHelper.CreateRangeFilter(fieldName, value.Lower, value.Upper, value.IncludeLower, value.IncludeUpper); var result = new TermAggregationRequest { Id = $"{fieldName}-{value.Id}", Filter = existingFilters.And(valueFilter) }; return(result); }
protected virtual AggregationRequest GetPriceRangeFilterValueAggregationRequest(PriceRangeFilter priceRangeFilter, RangeFilterValue value, IEnumerable <IFilter> existingFilters, IList <string> pricelists) { var valueFilter = FiltersHelper.CreatePriceRangeFilter(priceRangeFilter.Currency, pricelists, value.Lower, value.Upper, value.IncludeLower, value.IncludeUpper); var result = new TermAggregationRequest { Id = $"{priceRangeFilter.Key}-{value.Id}", Filter = existingFilters.And(valueFilter) }; return(result); }