mardi 30 juin 2015

Update CloudSearch document using Python boto

I am using the latest boto tools for Python to add and search documents on Amazon CloudSearch. I haven't been able to find any documentation regarding the updates of documents. There is documentation for the old API here: http://ift.tt/1U5dt5u. Here, when adding a document you give a version number, and to quote the docs:

If you wish to update a document, you must use a higher version ID.

However, I don't find this feature in the boto namespaces for the new API (the ones with cloudsearch2). The add function no longer takes a version.

Currently what I am doing to update a document is getting it by ID, then adding it again. The logic of updating the fields is on my side.

What would be nice is to add a document with the same ID and higher version number and only fill in the fields that you want overridden, and the document should be updated.

Is there still a way to use the version of a document in the new boto API?




Aucun commentaire:

Enregistrer un commentaire