You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,77 @@
2
2
3
3
All notable changes to this `laravel-elasticsearch` package will be documented in this file.
4
4
5
+
## v5.1.0 - 2025-08-20
6
+
7
+
This release is compatible with Laravel 10, 11 & 12
8
+
9
+
#### 1. New feature, `withTrackTotalHits(bool|int|null $val = true)`
10
+
11
+
Appends the `track_total_hits` parameter to the DSL query, setting value to `true` will count all the hits embedded in the query meta not capping to Elasticsearch default of 10k hits
#### 2. New feature, `createOrFail(array $attributes)`
32
+
33
+
By default, when using `create($attributes)` where `$attributes `has an `id` that exists, the operation will upsert. `createOrFail` will throw a `BulkInsertQueryException` with status code `409` if the `id` exists
34
+
35
+
```php
36
+
Product::createOrFail([
37
+
'id' => 'some-existing-id',
38
+
'name' => 'Blender',
39
+
'price' => 30,
40
+
]);
41
+
42
+
```
43
+
#### 3. New feature `withRefresh(bool|string $refresh)`
44
+
45
+
By default, inserting documents will wait for the shards to refresh, ie: `withRefresh(true)`, you can set the refresh flag with the following (as per ES docs):
46
+
47
+
-`true` (default)
48
+
Refresh the relevant primary and replica shards (not the whole index) immediately after the operation occurs, so that the updated document appears in search results immediately.
49
+
-`wait_for`
50
+
Wait for the changes made by the request to be made visible by a refresh before replying. This doesn’t force an immediate refresh, rather, it waits for a refresh to happen.
51
+
-`false`
52
+
Take no refresh-related actions. The changes made by this request will be made visible at some point after the request returns.
53
+
54
+
```php
55
+
Product::withRefresh('wait_for')->create([
56
+
'name' => 'Blender',
57
+
'price' => 30,
58
+
]);
59
+
60
+
```
61
+
### PRS
62
+
63
+
* Add withTrackTotalHits method to Builder class to add track_total_hits by @caufab in https://github.com/pdphilip/laravel-elasticsearch/pull/76
64
+
* feat(query): add op_type=create support and dedupe helpers by @abkrim in https://github.com/pdphilip/laravel-elasticsearch/pull/79
65
+
66
+
### Bugfix
67
+
68
+
* Laravel ^12.23 Compatibility - close [#81](https://github.com/pdphilip/laravel-elasticsearch/issues/81)
69
+
70
+
### New Contributors
71
+
72
+
*@caufab made their first contribution in https://github.com/pdphilip/laravel-elasticsearch/pull/76
0 commit comments