Make SignificantTerms.Bucket an interface rather than an abstract class

Related to elastic/elasticsearch#24670

Original commit: elastic/x-pack-elasticsearch@e5b0123fbc
This commit is contained in:
Tanguy Leroux 2017-05-15 15:19:19 +02:00
parent e36e2c604d
commit ffcee524c5
1 changed files with 2 additions and 2 deletions

View File

@ -668,7 +668,7 @@ public class TransportGraphExploreAction extends HandledTransportAction<GraphExp
VertexRequest vr = rootHop.getVertexRequest(j); VertexRequest vr = rootHop.getVertexRequest(j);
if (request.useSignificance()) { if (request.useSignificance()) {
SignificantTerms significantTerms = sample.getAggregations().get("field" + j); SignificantTerms significantTerms = sample.getAggregations().get("field" + j);
List<Bucket> buckets = significantTerms.getBuckets(); List<? extends Bucket> buckets = significantTerms.getBuckets();
for (Bucket bucket : buckets) { for (Bucket bucket : buckets) {
double signalWeight = bucket.getSignificanceScore() / totalSignalStrength; double signalWeight = bucket.getSignificanceScore() / totalSignalStrength;
addVertex(vr.fieldName(), bucket.getKeyAsString(), signalWeight, addVertex(vr.fieldName(), bucket.getKeyAsString(), signalWeight,
@ -695,7 +695,7 @@ public class TransportGraphExploreAction extends HandledTransportAction<GraphExp
if (request.useSignificance()) { if (request.useSignificance()) {
// Signal is based on significance score // Signal is based on significance score
SignificantTerms significantTerms = sample.getAggregations().get("field" + i); SignificantTerms significantTerms = sample.getAggregations().get("field" + i);
List<Bucket> buckets = significantTerms.getBuckets(); List<? extends Bucket> buckets = significantTerms.getBuckets();
for (Bucket bucket : buckets) { for (Bucket bucket : buckets) {
totalSignalStrength += bucket.getSignificanceScore(); totalSignalStrength += bucket.getSignificanceScore();
} }