I need your help to translate a query into pyes. This query is working properly, the problem is that I can't use pyes to make it work:
curl -XGET 'http://127.0.0.1:9200/my_index/user/_search?pretty=1' -d '{
"query" : {
"bool":{
"should": [
{ "text": { "first_name": "em" }},
{ "text": { "first_name.partial": "em" }}
]
}
}
}'
First I was doing this, according to 0.17 docs:
q1 = TextQuery("first_name","em")
q2 = TextQuery("first_name.partial","em")
q = BoolQuery(should=[q1, q2])
conn.search(q,indices='my_index',doc_types='user')
After a few exceptions raised, i realized that i've installed 0.16, because 0.17 is an unstable branch.
So, to put it simple: How can I translate search that query with pyes?
Thanks!