// This file is autogenerated, DO NOT EDIT
// mapping/params/multi-fields.asciidoc:10

[source, python]
----
resp = client.indices.create(
    index="my-index-000001",
    mappings={
        "properties": {
            "city": {
                "type": "text",
                "fields": {
                    "raw": {
                        "type": "keyword"
                    }
                }
            }
        }
    },
)
print(resp)

resp1 = client.index(
    index="my-index-000001",
    id="1",
    document={
        "city": "New York"
    },
)
print(resp1)

resp2 = client.index(
    index="my-index-000001",
    id="2",
    document={
        "city": "York"
    },
)
print(resp2)

resp3 = client.search(
    index="my-index-000001",
    query={
        "match": {
            "city": "york"
        }
    },
    sort={
        "city.raw": "asc"
    },
    aggs={
        "Cities": {
            "terms": {
                "field": "city.raw"
            }
        }
    },
)
print(resp3)
----
