// This file is autogenerated, DO NOT EDIT
// mapping/types/keyword.asciidoc:222

[source, python]
----
resp = client.indices.create(
    index="idx",
    settings={
        "index": {
            "mapping": {
                "source": {
                    "mode": "synthetic"
                }
            }
        }
    },
    mappings={
        "properties": {
            "kwd": {
                "type": "keyword",
                "store": True
            }
        }
    },
)
print(resp)

resp1 = client.index(
    index="idx",
    id="1",
    document={
        "kwd": [
            "foo",
            "foo",
            "bar",
            "baz"
        ]
    },
)
print(resp1)
----
