fix(search-backend-module-elasticsearch): use targeted index refresh instead of full cluster refresh

Signed-off-by: nojaf <florian.verdonck@outlook.com>
This commit is contained in:
nojaf
2026-01-20 15:30:40 +01:00
parent cfac8a460d
commit 46da01c26c
2 changed files with 4 additions and 2 deletions
@@ -60,10 +60,11 @@ describe('ElasticSearchSearchEngineIndexer', () => {
bulkSpy,
);
refreshSpy = jest.fn().mockReturnValue({});
// Use specific pattern to avoid conflict with /some-type-index__* wildcard mock
mock.add(
{
method: 'GET',
path: '/:index/_refresh',
path: '/some-type-index__:ts/_refresh',
},
refreshSpy,
);
@@ -97,7 +97,8 @@ export class ElasticSearchSearchEngineIndexer extends BatchSearchEngineIndexer {
: {}),
};
},
refreshOnCompletion: options.skipRefresh !== true,
refreshOnCompletion:
options.skipRefresh !== true ? that.indexName : false,
});
// Safely catch errors thrown by the bulk helper client, e.g. HTTP timeouts