File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
server/services/lifecycle Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,24 @@ module.exports = ({ strapi }) => {
7777 . plugin ( 'meilisearch' )
7878 . service ( 'meilisearch' )
7979
80- const entries = await contentTypeService . getEntries ( {
80+ const nbrEntries = await contentTypeService . numberOfEntries ( {
8181 contentType : contentTypeUid ,
82- filters : event . params . where ,
82+ where : event . params . where ,
8383 } )
8484
85+ const entries = [ ]
86+ const BATCH_SIZE = 500
87+
88+ for ( let pos = 0 ; pos < nbrEntries ; pos += BATCH_SIZE ) {
89+ const batch = await contentTypeService . getEntries ( {
90+ contentType : contentTypeUid ,
91+ filters : event . params . where ,
92+ start : pos ,
93+ limit : BATCH_SIZE ,
94+ } )
95+ entries . push ( ...batch )
96+ }
97+
8598 meilisearch
8699 . updateEntriesInMeilisearch ( {
87100 contentType : contentTypeUid ,
You can’t perform that action at this time.
0 commit comments