Open
Description
Generate these structures using https://github.com/elastic/elasticsearch-specification and make them available through elasticsearch.types.*
modules. This will allow having type-hints for APIs, especially useful for complex structures like query DSL:
from elasticsearch import Elasticsearch
from elasticsearch.types import ExpandWildcards, MatchQuery
client = Elasticsearch()
client.search(
index="index",
expand_wildcards=[ExpandWildcards.OPEN, ExpandWildcards.CLOSED],
query={
"match": {
"field": MatchQuery(query="text")
}
}
)
All of these structures would be serialized to the proper JSON/HTTP structures before being handed to the transport layer.