无法使用boto 2.31.1创建cloudsearch int index字段

时间:2014-07-22 17:17:44

标签: python amazon-web-services boto amazon-cloudsearch

我正在尝试使用python和boto 2.31.1在cloudsearch域中创建索引字段。

我可以成功为类型'text','int-array'和'literal'而不是'int'创建索引字段

e.g。

这成功了:

dom_comments.create_index_field('some_text_field', 'text')  

但这失败了:

dom_comments.create_index_field('some_int_field', 'int')

出现此错误:

JSONResponseError: JSONResponseError: 400 Bad Request
{u'RequestId': u'436bca63-11c3-11e4-be49-c9eca06e67ee', u'Error': {u'Message': u'missing     value for long type', u'Code': u'MalformedInput', u'Type': u'Sender'}}

dom_comments的班级是boto.cloudsearch2.domain.Domain

1 个答案:

答案 0 :(得分:3)

找到答案。

创建' int'时必须指定默认值。 index_field。所以这有效:

dom_comments.create_index_field('some_int_field', 'int', default=0)    

我在Debian Wheezy上使用python 2.7.3。