ES5: Combined range and terms filter?

Hi,

I'm not sure how to write a query the should filter on range and term. I have tried this (without the dots!) but it does not work:

{
...."size": 8,
...."query": {
........"bool": {
............"filter": {
................"bool": {
...................."must": {
........................"range": {
............................."timestamp": {
.................................."gte": 0,
.................................."lte": 8888888888
.............................}
.........................},
........................."terms": {
............................."myfield": ["aValue"]
.........................}
.....................}
.................}
.............},
............."must": {
................."query_string": {
....................."query": "something",
....................."fields": ["description"]
.................}
.............}
.........}
....}
}

Any pointers would be much appreciated.

Cheers,

Stuart

Sorry, just found the solution myself. The must element should have been followed by a list.

1 Like

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