嗨,我正在尝试通过python弹性搜索来实现映射。我想在代码中添加大小写密集型映射。请检查地图并帮助我。正在获取500传输错误,而不是内容异常。在
mapping = '''
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"analyzer_keyword": {
"tokenizer": "keyword",
"filter": "lowercase"
}
}
}
}
},
"mappings": {
"countrycpm": {
"properties": {
"uid": {
"type": "text"
},
"country": {
"type": "text"
},
"cpm": {
"type": "float"
},
"createdby": {
"type": "text"
},
"updatedby": {
"type": "text"
},
"createddate": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
},
"updateddate": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
},
"status = mode": {
"type": "integer"
},
"createdbyname": {
"type": "text"
},
"updatedbyname": {
"type": "text"
}
}
}
}
}
'''
els.indices.put_mapping(index = ES_INDEX, doc_type = 'countrycpm',body=json.dumps(mapping))
回应
^{pr2}$
不能像这样在索引中更新映射,必须创建新映射并将此映射分配为新变量,否则必须删除索引并相应地更新它。在
相关问题 更多 >
编程相关推荐