From 2d24b568444819fbf6a86f75890006b12e22b183 Mon Sep 17 00:00:00 2001 From: Paula Date: Fri, 3 Jul 2026 14:02:45 +0200 Subject: [PATCH] fix(elasticsearch): refresh the index on bulkCreate like single-item writes createItem() and updateItem() request refresh=true so written documents are immediately searchable, but bulkCreate() did not. Current data trackers written by the populate command were therefore invisible to the tracker lookup until Elasticsearch refreshed on its own, and update logs arriving in that window were silently dropped because the handler found no tracker to compare against. --- CHANGELOG.md | 1 + src/Bridge/Elasticsearch/ElasticsearchService.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4309824..537bdec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `ElasticsearchService::getItemById()` always returned null because it compared the hit total against an integer while Elasticsearch returns an object +- `ElasticsearchService::bulkCreate()` now refreshes the index like `createItem()` and `updateItem()` already do; previously, current data trackers written by the populate command were not immediately searchable, so updates arriving right after population were silently dropped ## [1.2.0] - 2026-07-02 diff --git a/src/Bridge/Elasticsearch/ElasticsearchService.php b/src/Bridge/Elasticsearch/ElasticsearchService.php index 50d3737..bc54084 100644 --- a/src/Bridge/Elasticsearch/ElasticsearchService.php +++ b/src/Bridge/Elasticsearch/ElasticsearchService.php @@ -53,6 +53,7 @@ public function bulkCreate(array $items, string $index, array $groups = []): voi $request = [ 'index' => $index, 'body' => $params, + 'refresh' => 'true', ]; $this->elasticsearchClient->getClient()->bulk($request);