brewster / elastictastic

Object-document mapper and lightweight API adapter for ElasticSearch
MIT License
88 stars 13 forks source link

Implement concurrency-safe create operation #2

Closed outoftime closed 12 years ago

outoftime commented 12 years ago

Elastictastic currently implements an ::update method, which allows applications to perform modifications to a document and transparently retry in the case of a version conflict. Implement a ::create_or_update method that attempts to create a document, and then retries with an update in the case of a DocumentAlreadyExists. This would, of course, only be meaningful in the case when IDs are set by the application on creation.