我目前在elasticsearch中使用語言分析器。在這裏我發現,如果我們需要使用分析器來搜索文檔,那麼我們需要定義映射和分析器。 在我的情況下,如果文檔包含一個普通的文本字段,這可以正常工作,但是當我將相同的屬性應用於嵌套字段時,分析器不起作用。如何在語言分析器中使用嵌套映射
這是語言分析器
PUT checkmap
{
"settings": {
"analysis": {
"analyzer": {
"stemmerenglish": {
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
"my_stemmer"
]
}
},
"filter": {
"my_stemmer": {
"type": "stemmer",
"name": "english"
}
}
}
},
"mappings": {
"dd": {
"properties": {
"Courses": {
"type": "nested",
"properties": {
"Sname": {
"type": "text",
"analyzer": "stemmerenglish",
"search_analyzer": "stemmerenglish"
}
}
}
}
}
}
}
代碼請幫我出上述問題。
您提供上面的映射。你怎麼知道你的分析儀不工作。你運行哪個查詢不起作用?請分享一下。 – Richa
PUT checkmap/DD/2 { 「課程」:[ { 「SNAME」: 「跳」 } ] } GET checkmap3/_search { 「查詢」:{ 「匹配」: { 「Courses.Sname」:{ 「查詢」: 「跳轉」 }} } } 謝謝 – honey