# Multiple range searches on one search field in query

**URL:** <https://discuss.elastic.co/t/multiple-range-searches-on-one-search-field-in-query/175263>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [April 3, 2019, 6:25pm UTC](https://discuss.elastic.co/t/multiple-range-searches-on-one-search-field-in-query/175263 "2019-04-03T18:25:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashtonlance](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@ashtonlance](https://discuss.elastic.co/u/ashtonlance)\
**Post date:** [April 3, 2019, 6:25pm UTC](https://discuss.elastic.co/t/multiple-range-searches-on-one-search-field-in-query/175263/1 "2019-04-03T18:25:22Z")

</div>

I'm trying to run a query that on a field called `bookable_date` . I want to be able to return results that have a `bookable_date` in May and a `bookable_date` in July and not return results for the month of June. I'm using the first-party PHP client here: [GitHub - swiftype/swiftype-site-search-php](https://github.com/swiftype/swiftype-site-search-php)

Here's one of my approaches -- no results.

```auto
$args['bookable_date'] = array(
  "type"=> "or",
   "values"=> array(
      array(
       "type"=>"range",
          "from"=>'2019-01-01T00:00:00+00:00',
           "to"=> '2019-01-31T00:00:00+00:00',
         ),
          array (
            "type"=>"range",
             "from"=>'2019-05-01T00:00:00+00:00',
              "to"=> '2019-05-31T00:00:00+00:00',
             )
   )
  );

```

The `$args` variable is later passed to `$st_args` in the filters array. Which is then sent to Swiftype like this:  
`$response = $client->search($engine , stripslashes($s), $st_args);`

---

<div class="post-metadata">

**Author:** ![goodroot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goodroot/32/38389_2.png) [@goodroot](https://discuss.elastic.co/u/goodroot)\
**Post date:** [April 4, 2019, 3:56pm UTC](https://discuss.elastic.co/t/multiple-range-searches-on-one-search-field-in-query/175263/2 "2019-04-04T15:56:43Z")

</div>

Hello, ashtonlance ~

Welcome to the community ! 🎉

It looks like Aurelien got back to you within a GitHub issue.

For those following along, a workaround is needed as multiple range filters are not supported as of today.

Read more within GitHub: [https://github.com/swiftype/swiftype-site-search-php/issues/21](https://github.com/swiftype/swiftype-site-search-php/issues/21).

Enjoy the day,

Kellen

---

<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:** [May 2, 2019, 3:56pm UTC](https://discuss.elastic.co/t/multiple-range-searches-on-one-search-field-in-query/175263/3 "2019-05-02T15:56:49Z")

</div>

Closed on May 2, 2019, 3:56pm UTC

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