// This file is autogenerated, DO NOT EDIT
// analysis/tokenfilters/limit-token-count-tokenfilter.asciidoc:123

[source, python]
----
resp = client.indices.create(
    index="custom_limit_example",
    settings={
        "analysis": {
            "analyzer": {
                "whitespace_five_token_limit": {
                    "tokenizer": "whitespace",
                    "filter": [
                        "five_token_limit"
                    ]
                }
            },
            "filter": {
                "five_token_limit": {
                    "type": "limit",
                    "max_token_count": 5
                }
            }
        }
    },
)
print(resp)
----
