babenkoivan / elastic-scout-driver-plus

Extension for Elastic Scout Driver
MIT License
267 stars 52 forks source link

rawSeach + range #72

Closed usovichivan closed 3 years ago

usovichivan commented 3 years ago

is it possible to combine "match" with "range" something like this? $searchResult = Lot1::rawSearch() ->query([ 'match' => ['body_style' => 'SUV'], "range" => [ "bid" => ["gte" => 1000, "lte" => 10000] ] ]) ->aggregate('exterior_color', [ 'terms' => [ 'field' => 'exterior_color', ], ]) ->aggregate('drive_train', [ 'terms' => [ 'field' => 'drive_train', ], ]) ->size(25) ->execute();

babenkoivan commented 3 years ago

Hi @usovichivan, I think a boolean query would work for you, something like:

$searchResult = Lot1:: boolSearch()
    ->must('match', ['body_style' => 'SUV'])
    ->must('range', ['bid' => ['gte' => 1000, 'lte' => 10000]])
    // -> ...
github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days