// This file is autogenerated, DO NOT EDIT
// mapping/types/rank-feature.asciidoc:11

[source, python]
----
resp = client.indices.create(
    index="my-index-000001",
    mappings={
        "properties": {
            "pagerank": {
                "type": "rank_feature"
            },
            "url_length": {
                "type": "rank_feature",
                "positive_score_impact": False
            }
        }
    },
)
print(resp)

resp1 = client.index(
    index="my-index-000001",
    id="1",
    document={
        "pagerank": 8,
        "url_length": 22
    },
)
print(resp1)

resp2 = client.search(
    index="my-index-000001",
    query={
        "rank_feature": {
            "field": "pagerank"
        }
    },
)
print(resp2)
----
