Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
babenkoivan committed May 31, 2024
1 parent 57c3a54 commit 4396d2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/compound-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ $query = Query::bool()->filterRaw([
$searchResult = Book::searchQuery($query)->execute();
```

Note that `filterRaw` completely replaces the `filter` clause of the query.

### <a name="bool-minimum-should-match"></a> minimumShouldMatch

You can use `minimumShouldMatch` to specify [the number of `should` queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html#bool-min-should-match)
Expand Down Expand Up @@ -110,6 +112,8 @@ $query = Query::bool()->mustRaw([
$searchResult = Book::searchQuery($query)->execute();
```

Note that `mustRaw` completely replaces the `must` clause of the query.

### <a name="bool-must-not"></a> mustNot

The query defined with `mustNot` [must not appear in the matching documents](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html)
Expand Down Expand Up @@ -145,6 +149,8 @@ $query = Query::bool()->mustNotRaw([
$searchResult = Book::searchQuery($query)->execute();
```

Note that `mustNotRaw` completely replaces the `must_not` clause of the query.

### <a name="bool-only-trashed"></a> onlyTrashed

Use `onlyTrashed` method to get [only soft deleted results](https://laravel.com/docs/master/scout#soft-deleting):
Expand Down Expand Up @@ -191,6 +197,8 @@ $query = Query::bool()->shouldRaw([
$searchResult = Book::searchQuery($query)->execute();
```

Note that `shouldRaw` completely replaces the `should` clause of the query.

### <a name="bool-with-trashed"></a> withTrashed

You can use `withTrashed` to include [soft deleted results](https://laravel.com/docs/master/scout#soft-deleting)
Expand Down

0 comments on commit 4396d2d

Please sign in to comment.