mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-28 23:02:12 +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) {
|
private static FacetResult parseRange(RangeFacet facet) {
|
||||||
List<Range> entries = new ArrayList<Range>();
|
List<Range> entries = new ArrayList<Range>();
|
||||||
for (RangeFacet.Entry entry : facet.getEntries()) {
|
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);
|
return new RangeResult(facet.getName(), entries);
|
||||||
}
|
}
|
||||||
|
@ -14,13 +14,18 @@ public class Range {
|
|||||||
private Double to;
|
private Double to;
|
||||||
private long count;
|
private long count;
|
||||||
private double total;
|
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, double totalCount, double min, double max) {
|
||||||
public Range(Double from, Double to, long count, double total) {
|
|
||||||
this.from = from;
|
this.from = from;
|
||||||
this.to = to;
|
this.to = to;
|
||||||
this.count = count;
|
this.count = count;
|
||||||
this.total = total;
|
this.total = total;
|
||||||
|
this.totalCount = totalCount;
|
||||||
|
this.min = min;
|
||||||
|
this.max = max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double getFrom() {
|
public Double getFrom() {
|
||||||
@ -43,4 +48,16 @@ public class Range {
|
|||||||
public double getTotal() {
|
public double getTotal() {
|
||||||
return total;
|
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