// This file is autogenerated, DO NOT EDIT
// mapping/types/ip.asciidoc:11

[source, python]
----
resp = client.indices.create(
    index="my-index-000001",
    mappings={
        "properties": {
            "ip_addr": {
                "type": "ip"
            }
        }
    },
)
print(resp)

resp1 = client.index(
    index="my-index-000001",
    id="1",
    document={
        "ip_addr": "192.168.1.1"
    },
)
print(resp1)

resp2 = client.search(
    index="my-index-000001",
    query={
        "term": {
            "ip_addr": "192.168.0.0/16"
        }
    },
)
print(resp2)
----
