繁体   English   中英

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

[英]Cannot create cloudsearch int index field with boto 2.31.1

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

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

例如

这成功了:

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

找到了答案。

创建“int”index_field时,必须指定默认值。 这样可行:

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

我在Debian Wheezy上使用python 2.7.3。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM