# Combining query string query with range query

**URL:** <https://discuss.elastic.co/t/combining-query-string-query-with-range-query/62771>\
**Category:** Elasticsearch\
**Created:** [October 12, 2016, 12:37am UTC](https://discuss.elastic.co/t/combining-query-string-query-with-range-query/62771 "2016-10-12T00:37:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![negar](https://avatars.discourse-cdn.com/v4/letter/n/6f9a4e/32.png) [@negar](https://discuss.elastic.co/u/negar)\
**Post date:** [October 12, 2016, 12:37am UTC](https://discuss.elastic.co/t/combining-query-string-query-with-range-query/62771/1 "2016-10-12T00:37:31Z")

</div>

Hi,

Following the advice given at [Combining simple\_query\_string with range and fuzziness](https://discuss.elastic.co/t/combining-simple-query-string-with-range-and-fuzziness/25263), I have came up with the following query:

```
   query = { 
            size: 500,
            from: event.currentPage,
            "query": {
                "indices": {
                    "indices":legit_indexes,
                    "query": {
                      "query_string": {
                        "query": '*'
                      },
                    "filter":{ 
                      "range": {
                                "@timestamp": {
                                  "gte": "now/d",
                                  "time_zone": "-3:00"
                                }
                              }
                            }
                    },
                    "no_match_query": "none"
                  }
            },
            "aggs": {
              "types": {
                "terms": {
                  "field": "datasource"
                }
              }
            }
        };

```

However this is still bringing me all the documents in the Elastic Search cluster! Does anybody know what is wrong about the query?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/combining-query-string-query-with-range-query/62771/2 "2017-07-05T22:13:14Z")

</div>


