// This file is autogenerated, DO NOT EDIT
// mapping/types/semantic-text.asciidoc:242

[source, python]
----
resp = client.indices.create(
    index="test-index",
    mappings={
        "properties": {
            "source_field": {
                "type": "text",
                "fields": {
                    "infer_field": {
                        "type": "semantic_text",
                        "inference_id": ".elser-2-elasticsearch"
                    }
                }
            }
        }
    },
)
print(resp)
----
