Hello all,
We have a single document in an index:
$ curl -XGET "http://localhost:9200/test-cbx/bug/_search?q=*" gives us
the following response
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"test-cbx","_type":"bug","_id":"1","_score":1.0,"_source":
{
"country": "lu",
"type": “some type"
}}]}}
And the following two queries give no results, even though it’s a should
clause:
$ curl -XGET "http://localhost:9200/test-cbx/bug/_search" -d'
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"should": {
"term": {
"country": "de"
}
}
}
}
}
}
}'
$ curl -XGET "http://localhost:9200/test-cbx/bug/_search" -d'
{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"match": {
"country": {
"query": "de"
}
}
}
]
}
},
"filter": {
"term": {
"type": “some type"
}
}
}
}
}'
What is the preferred way to approach the bool query? Filter or the query?
Regards,
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/25811121-bbb5-44c2-9c07-835597331917%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.