Build boolean queries with Query::bool()
masterYou can construct complex Elasticsearch boolean queries using the Elastic\ScoutDriverPlus\Support\Query::bool() method. This method allows you to compose multiple query clauses (like must, filter, should, etc.) to refine your search results. Once the query is built, you can execute it using the model's searchQuery($query)->execute() method.
$query = Query::bool()->must(
Query::match()
->field('title')
->query('The Book')
);
$searchResult = Book::searchQuery($query)->execute();