Skip to content

Bulk helper#1560

Merged
miguelgrinberg merged 11 commits into
mainfrom
bulk-helper
Apr 24, 2026
Merged

Bulk helper#1560
miguelgrinberg merged 11 commits into
mainfrom
bulk-helper

Conversation

@miguelgrinberg
Copy link
Copy Markdown
Contributor

@miguelgrinberg miguelgrinberg commented Mar 20, 2026

Closes #1537

A bulk helper class that creates and submits chunk requests according to size or operation count limits. The application just provides an iterator or generator that feeds items one by one. Example:

use Elastic\Elasticsearch\Helper\Bulk;

function get_next_document() {
    foreach($dataset as $document) {
        yield Bulk::index_action($document)
    }
}

Bulk::bulk($client, $index, get_next_document());

@miguelgrinberg miguelgrinberg force-pushed the bulk-helper branch 2 times, most recently from 76fd152 to 8b524f1 Compare March 24, 2026 16:02
@miguelgrinberg miguelgrinberg force-pushed the bulk-helper branch 2 times, most recently from fabc090 to a5812a3 Compare April 7, 2026 13:32
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

🔍 Preview links for changed docs

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 7, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@miguelgrinberg miguelgrinberg force-pushed the bulk-helper branch 2 times, most recently from b807d59 to 4eb0eff Compare April 7, 2026 14:59
@miguelgrinberg miguelgrinberg marked this pull request as ready for review April 7, 2026 15:15
Comment thread .github/workflows/yaml_test.yml Outdated
@miguelgrinberg miguelgrinberg merged commit d579e15 into main Apr 24, 2026
38 checks passed
@miguelgrinberg miguelgrinberg deleted the bulk-helper branch April 24, 2026 15:08
miguelgrinberg added a commit that referenced this pull request May 5, 2026
* Bulk helper

* explicit flush action

* documentation

* more docs improvements

* return status and error information

* update yaml tests to use 9.4 branch

* typos

* more docs improvements

* restore main branch in yaml tests

(cherry picked from commit d579e15)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk helper

2 participants