abstracts bulk api handling to a new method #449

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

rhec commented Sep 6, 2012

adds new methods to access the delete and create features of the bulk api
I've been using the bulk delete in production for a while with no problems.

@rhec rhec abstracts bulk api handling to a new method
adds new methods to access the delete and create features of the bulk api
c0195ad

karmi commented on c0195ad Aug 23, 2012

Send to @karmi

karmi closed this in 8e81c3a Nov 11, 2012

@karmi karmi added a commit that referenced this pull request Nov 11, 2012

@karmi karmi [#449] Refactor & cleanup the new bulk support
* Use plain `Tire::Index#bulk` method name for the generic method:

    Tire.index('articles').bulk :index, [ {:id => '1', :title => 'One'}, {:id => '2', :title => 'Two'} ]

* Keep the `bulk_create`, `bulk_store`, `bulk_delete` methods

* Replace dynamically defined tests in index unit test with concrete examples
d2ed980

@karmi karmi added a commit that referenced this pull request Nov 11, 2012

@karmi karmi [#449] Added support for the meta parameters such as routing, version…
…, etc in the Index#bulk API
91f18b5

@karmi karmi added a commit that referenced this pull request Nov 11, 2012

@karmi karmi [#449] Added support for URL parameters such as `refresh` or `consist…
…ency` in the Index#bulk API
34cc508
Owner

karmi commented Nov 11, 2012

Full changelog: 8e81c3a...1c0d043

Owner

karmi commented Nov 11, 2012

Rob — thanks, finally merged and cleaned up & amended up a bit, released as 0.5.1.

Contributor

woahdae commented Nov 16, 2012

Hey, thanks for adding support for parent relationships, but am I crazy, or is this weird: To get parent/child behavior I need to put the parent option in every document in ruby, so it can be subsequently deleted from the documents and inserted into the bulk meta, which just seems odd. It's not like you can have multiple parents per bulk action, so why not just pull it from the mapping? Plus #store accepts parent, but #update_index doesn't support it?

Maybe it's particular to my use case, but I would have expected to put :_parent in the mapping, since ES needs that already, and have #bulk and #store pull parent/routing info from the mapping.

I have a monkeypatch that does this already, prior to these changes, and am willing to make a pull request if you think it's a sane strategy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment