Merge pull request #32386 from nojaf/fix-opensearch-bulk
fix(search-backend-module-elasticsearch): improve index refresh
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-search-backend-module-elasticsearch': patch
|
||||
---
|
||||
|
||||
Fixed bulk indexing to refresh only the target index instead of all indexes, improving performance in multi-index deployments.
|
||||
+2
-1
@@ -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,
|
||||
);
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user