# How can I write multiple search with grater that less than query?

**URL:** https://discuss.elastic.co/t/how-can-i-write-multiple-search-with-grater-that-less-than-query/238429
**Category:** Elasticsearch
**Created:** [June 24, 2020, 10:03am UTC](https://discuss.elastic.co/t/how-can-i-write-multiple-search-with-grater-that-less-than-query/238429 "2020-06-24T10:03:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Yusuf\_Karatoprak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yusuf_karatoprak/32/44539_2.png) [@Yusuf\_Karatoprak](https://discuss.elastic.co/u/Yusuf_Karatoprak)
#### Post date: [June 24, 2020, 10:03am UTC](https://discuss.elastic.co/t/how-can-i-write-multiple-search-with-grater-that-less-than-query/238429/1 "2020-06-24T10:03:12Z")

</div>

How can I use grater than and less than with should match query in elasticsearch ?

```auto
    
{
    "query": {
        "range" : {
            "rate" : {
                "gte" : 0.6,
                "lte" : 1,
                "boost" : 2.0
            }
        },
            "bool": {
      "should": [
        { "match": { "target": "kairaba blue dreams resort spa" }},
        { "match": { "why": "A’la Carte Restoran,Kum Plaj,Çakıl Plaj" }}
        
      ]
    }
    }
}

```

Error:

```auto
{

  "error": {

    "root_cause": [

      {

        "type": "parsing_exception",

        "reason": "[range] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",

        "line": 11,

        "col": 13

      }

    ],

    "type": "parsing_exception",

    "reason": "[range] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",

    "line": 11,

    "col": 13

  },

  "status": 400

}

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 24, 2020, 12:01pm UTC](https://discuss.elastic.co/t/how-can-i-write-multiple-search-with-grater-that-less-than-query/238429/2 "2020-06-24T12:01:05Z")

</div>

I believe you need to write something like:

```auto
{
   "query":{
      "bool":{
         "must":[
            {
               "range":{
                  "rate":{
                     "gte":0.6,
                     "lte":1,
                     "boost":2.0
                  }
               }
            }
         ],
         "should":[
            {
               "match":{
                  "target":"kairaba blue dreams resort spa"
               }
            },
            {
               "match":{
                  "why":"A’la Carte Restoran,Kum Plaj,Çakıl Plaj"
               }
            }
         ]
      }
   }
}

```

---

<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 22, 2020, 12:01pm UTC](https://discuss.elastic.co/t/how-can-i-write-multiple-search-with-grater-that-less-than-query/238429/3 "2020-07-22T12:01:24Z")

</div>

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