我将映射映射到字段question_title
,其内容如下:
PUT mac/_settings
{
"mappings": {
"ask_expert_published_prod": {
"properties": {
"question_title": {
"type": "string",
"analyzer": "english"
}
}
}
}
}
但是,当我通过以下方式看到类型的映射时:
GET myindex/mytype/_mapping
它仍然只为该字段显示type ='string',如下所示:
"question_title": {
"type": "string"
},
映射是否在现场正确更新。如果没有,我该怎么办。
最佳答案
在您的初始命令中,从路径中删除_settings
,因为它仅用于更新索引设置而不是映射。
只需运行以下命令:
PUT mac
{
"mappings": {
"ask_expert_published_prod": {
"properties": {
"question_title": {
"type": "string",
"analyzer": "english"
}
}
}
}
}
关于elasticsearch - 映射不适用于elasticsearch中的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36061652/