所有.
我使用的python elasticsearch版本是
import elasticsearch
print elasticsearch.__version__
(5,1)
映射是
request_body = {
'mappings':{
'post': {
'properties': {
'title': {
'type': 'text',}
}
}
}
}
错误是:
{u’status’: 400,u’error’: {u’caused_by’: {u’reason’: u’No handler for
type [text] declared on field [title]’,u’type’:
u’mapper_parsing_exception’},u’root_cause’: [{u’reason’: u’No handler
for type [text] declared on field [title]’,u’type’:
u’mapper_parsing_exception’}],u’type’: u’mapper_parsing_exception’,
u’reason’: u’Failed to parse mapping [post]: No handler for type
[text] declared on field [title]’}}
为什么es 5.0无法识别“文本”类型?我的设置有什么问题?
非常感谢!
最佳答案
您的映射中存在一些问题.用双引号替换所有单引号,并在最后一行(字段类型定义)后删除.
{
"mappings":{
"post":{
"properties":{
"title":{
"type":"text"
}
}
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。