// This file is autogenerated, DO NOT EDIT
// aggregations/bucket/composite-aggregation.asciidoc:748

[source, python]
----
resp = client.indices.create(
    index="my-index-000001",
    settings={
        "index": {
            "sort.field": [
                "username",
                "timestamp"
            ],
            "sort.order": [
                "asc",
                "desc"
            ]
        }
    },
    mappings={
        "properties": {
            "username": {
                "type": "keyword",
                "doc_values": True
            },
            "timestamp": {
                "type": "date"
            }
        }
    },
)
print(resp)
----
