Skip to content

Commit d7b39c5

Browse files
expaniandrross
authored andcommitted
Implemented cost function
Signed-off-by: expani <[email protected]>
1 parent bafd903 commit d7b39c5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,7 @@ public int nextDoc() throws IOException {
458458

459459
@Override
460460
public long cost() {
461-
// don't expect this to be called based on its usage in DefaultBulkScorer
462-
throw new UnsupportedOperationException();
461+
return queue.top() == null ? 0 : queue.top().approximation.cost();
463462
}
464463
}
465464

0 commit comments

Comments
 (0)