// This file is autogenerated, DO NOT EDIT
// migration/apis/create-index-from-source.asciidoc:94

[source, python]
----
resp = client.indices.create_from(
    source="my-index",
    dest="my-new-index",
    create_from={
        "settings_override": {
            "index": {
                "number_of_shards": 5
            }
        },
        "mappings_override": {
            "properties": {
                "field2": {
                    "type": "boolean"
                }
            }
        }
    },
)
print(resp)
----
