clintongormley / Elastic-Model

Use ElasticSearch as a NoSQL database in Perl
9 stars 8 forks source link

Add support for bulk indexing #16

Closed clintongormley closed 11 years ago

clintongormley commented 11 years ago

Add Elastic::Model::Bulk to save/overwrite documents in batches for improved performance:

$bulk = $model->bulk(
    size        => 1000,
    on_conflict => sub {...},
    on_error    => sub {...}
);

$bulk->save($doc);
$bulk->overwrite($doc);
...

$bulk->commit;