Multiple must conditions not working


(Timothy Choi) #1

I'm trying to run this query on ES 5.4:

POST /_search?pretty&size=500
{
"query": {
	"bool": {
		"must": [
			{
				"match": {
					"tags": "MY_TAG"
				}
			},
			{
				"range": {
					"timestamp": {
						"gt": 0,
						"format": "epoch_millis"
					}
				}
			}
		]
	}
}

(If it's not obvious, the document should have the tag MY_TAG, and the timestamp of the document should be greater than 0 (i.e. document should be created after this timestamp))

If I have either the match tag condition or the timestamp greater-then condition, the search returns something. However if I have them both together, the search returns an empty set. Does anybody know what I'm doing wrong?


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.