Multiple range searches on one search field in query

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

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

$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);

Hello, ashtonlance ~

Welcome to the community ! :tada:

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.

Enjoy the day,

Kellen

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