When indexing items via drush, all indexes are indexed in batches of Cron batch size of the first index loaded by search_api.

Steps to reproduce:
- Create two indexes with different values for the Cron batch size setting. E.g. 5 and 10.
- Add enough data to need at least 2 batches for each index
- Run the command drush search-api:index

Actual result:
- All indexes are indexed in steps of the size defined by the Cron batch size setting of the first index loaded.

Expected result:
- Each index is indexed in steps of the size of it's own Cron batch size setting.

Comments

ribeirobreno created an issue. See original summary.

ribeirobreno’s picture

Issue summary: View changes
ribeirobreno’s picture

Issue summary: View changes
drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new2.62 KB

Thanks for reporting this problem, and sorry it took me a bit to get back to you!
The issue in the code is pretty obvious, now that you point it out. Please test the attached patch to see if it resolves the problem correctly!
(I couldn’t resist including a bit more clean-up for this method in the patch, but this should be the only functional change.)

  • drunken monkey committed 2e99150 on 8.x-1.x
    Issue #3092347 by drunken monkey: Fixed batch size when indexing for...
drunken monkey’s picture

Status: Needs review » Fixed

Would have been great to get a test/review, but I’m fairly certain the patch works as intended. So: committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.