def create_mapping():
headers = {
'Content-Type': "application/json"
}
#使用ik分词
param = {
"properties":
{
"title":{"type":"text","analyzer":"ik_max_word","search_analyzer":"ik_max_word","similarity":"BM25"}
}
}
url = f'{root_url}/post/_mapping?include_type_name=true'
res = requests.post(url, data=json.dumps(param), headers=headers)
return res.json()
提示错误
Failed to parse mapping [post]: analyzer [ik_max_word] has not been configured in mappings
这是没有安装分词器