// This file is autogenerated, DO NOT EDIT
// query-dsl/percolate-query.asciidoc:157

[source, python]
----
resp = client.search(
    index="my-index-000001",
    query={
        "constant_score": {
            "filter": {
                "percolate": {
                    "field": "query",
                    "document": {
                        "message": "A new bonsai tree in the office"
                    }
                }
            }
        }
    },
)
print(resp)
----
