嗨,我正在尝试按照以下方式将文档添加到 cloudsearch 域
http://docs.pythonboto.org/en/latest/cloudsearch_tut.html#adding-documents-to-the-index
我的代码 snppet 是:
import boto
conn = boto.connect_cloudsearch(aws_access_key_id='<>',aws_secret_access_key='<>')
domain = conn.lookup('testfoo')
doc_service = domain.get_document_service()
doc_service.add(doc_id, version, data)
首先,我 在 GAE 上遇到了相同的请求问题 Boto CloudSearch:TypeError: request() got an unexpected keyword argument 'config'
所以我删除了 config kwarg (也不确定后果)然后我得到了
boto.cloudsearch.document.CommitMismatchError: Incorrect number of adds returned. Commit: 1 Response: 0
我的数据是这样的
[
{
"raw" : "whole bunch of raw text",
"title" : "My new title",
"blurb" : "A really exciting article",
"document_type" : "Tech Guide",
"url" : "http://www.foobar/7199/tech-advice"
}
]
非常感谢任何帮助