# A problem with query searching using JSON

**URL:** https://discuss.elastic.co/t/a-problem-with-query-searching-using-json/200566
**Category:** Kibana
**Created:** [September 22, 2019, 9:40am UTC](https://discuss.elastic.co/t/a-problem-with-query-searching-using-json/200566 "2019-09-22T09:40:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![resun](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@resun](https://discuss.elastic.co/u/resun)
#### Post date: [September 22, 2019, 9:40am UTC](https://discuss.elastic.co/t/a-problem-with-query-searching-using-json/200566/1 "2019-09-22T09:40:01Z")

</div>

Hey guys, I am running this code to the value of the field as I mentioned below over the range that I have also mentioned below. For some reasons, it shows me that there is no query registered for filtered and the code does not work. If anyone has any idea with this, please do give out some help.

POST filebeat\*/\_search  
{  
"query": {  
"filtered": {  
"query": {  
"match": {  
"query": "aAZbOG0BfQqr92KY\_bua",  
"field": "\_id"

```
      }
    },
     "filter": { 
        "range" : { 
          "timestamp":{
            "gte": "1568591458676"
          
  }
}

```

}

```
}
},
"_source": ["_id", "ecs.version", "timestamp"]

```

}

---

<div class="post-metadata">

### Author: ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)
#### Post date: [September 24, 2019, 12:43pm UTC](https://discuss.elastic.co/t/a-problem-with-query-searching-using-json/200566/2 "2019-09-24T12:43:13Z")

</div>

Hi @resun

can you please format your query using the `Preformatted text` option so it's a bit more readable?

Seems that you are issuing a wrong ES query. I suggest you to check this [https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-filter-context.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/query-filter-context.html) to see how you can write a query with a filter

---

<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: [October 22, 2019, 12:43pm UTC](https://discuss.elastic.co/t/a-problem-with-query-searching-using-json/200566/3 "2019-10-22T12:43:21Z")

</div>

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