I am trying to use the latest boto 0.36 with cloudsearch, I made connection using connect_cloudsearch2:
user = {
'id': 4,
'username': 'daniella',
'last_activity': 1334253279,
'follower_count': 7,
'location': 'USA',
'snippet': 'Just like Dan, I like to watch a good sunset, but heights scare me.',
}
doc_service = domain.get_document_service()
for user in users:
doc_service.add(user['id'], user['last_activity'], user)
#doc_service.add(user['id'], user) #this does not work either
complete = doc_service.commit()
Error I get is on the line with the doc_service.add (it comes straight from the docs):
TypeError: add() takes exactly 3 arguments (4 given)
If the commented "doc_service.add" line is used instead of the line above it, the error is:
boto.cloudsearch2.document.CommitMismatchError: Incorrect number of adds returned. Commit: 1 Response: 0
No documents get added/committed in either case. The cloud seems very difficult to use... anyone have any ideas?
Aucun commentaire:
Enregistrer un commentaire