Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution hint documentation added to cardinality agg #8265

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions _aggregations/metric/cardinality.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,26 @@ GET opensearch_dashboards_sample_data_ecommerce/_search
}
}
}
```

You can choose the mechanism by which the aggregation is executed with the `execution_hint` setting. This setting accepts two values:

1. `direct`: Use field values directly.
2. `ordinals`: Use ordinals of the field.

If not specified, mechanism that is appropriate for the field is selected. Note that specifying `ordinals` on a non-ordinal field will have no effect. Similarly, `direct` will have no effect on ordinal fields.

```json
GET opensearch_dashboards_sample_data_ecommerce/_search
{
"size": 0,
"aggs": {
"unique_products": {
"cardinality": {
"field": "products.product_id",
"execution_hint": "ordinals"
}
}
}
}
```
Loading