// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/rare-terms-aggregation.asciidoc:308

[source, python]
----
resp = client.search(
    aggs={
        "genres": {
            "rare_terms": {
                "field": "genre",
                "include": [
                    "swing",
                    "rock"
                ],
                "exclude": [
                    "jazz"
                ]
            }
        }
    },
)
print(resp)
----
