mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-28 14:52:20 +00:00
DATAES-10 added 3 additional properties to Range Facet
This commit is contained in:
parent
839d4f3898
commit
aa6a5e3753
@ -39,7 +39,7 @@ public class FacetMapper {
|
||||
private static FacetResult parseRange(RangeFacet facet) {
|
||||
List<Range> entries = new ArrayList<Range>();
|
||||
for (RangeFacet.Entry entry : facet.getEntries()) {
|
||||
entries.add(new Range(entry.getFrom() == Double.NEGATIVE_INFINITY ? null : entry.getFrom(), entry.getTo() == Double.POSITIVE_INFINITY ? null : entry.getTo(), entry.getCount(), entry.getTotal()));
|
||||
entries.add(new Range(entry.getFrom() == Double.NEGATIVE_INFINITY ? null : entry.getFrom(), entry.getTo() == Double.POSITIVE_INFINITY ? null : entry.getTo(), entry.getCount(), entry.getTotal(), entry.getTotalCount(), entry.getMin(), entry.getMax()));
|
||||
}
|
||||
return new RangeResult(facet.getName(), entries);
|
||||
}
|
||||
|
@ -14,13 +14,18 @@ public class Range {
|
||||
private Double to;
|
||||
private long count;
|
||||
private double total;
|
||||
private double totalCount;
|
||||
private double min = Double.POSITIVE_INFINITY;
|
||||
private double max = Double.NEGATIVE_INFINITY;
|
||||
|
||||
|
||||
public Range(Double from, Double to, long count, double total) {
|
||||
public Range(Double from, Double to, long count, double total, double totalCount, double min, double max) {
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.count = count;
|
||||
this.total = total;
|
||||
this.totalCount = totalCount;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public Double getFrom() {
|
||||
@ -43,4 +48,16 @@ public class Range {
|
||||
public double getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public double getTotalCount() {
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public double getMin() {
|
||||
return min;
|
||||
}
|
||||
|
||||
public double getMax() {
|
||||
return max;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user