我正在为文档定义一个索引模板,它具有未知数量的字段(字段本身也是未知的)。
我想为索引设置Map定义,我可以在整个文档中执行(在我的网站UI中)文本搜索(不区分大小写),在每个单独的字段中进行文本搜索(不区分大小写),并按每个字段进行排序(所有数字或字符串)。
这样做对吗?通过使用dynamic_template
并向他提供:
[
{
"strings_as_keyword": {
"match_mapping_type": "string",
"mapping": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
{
"numbers_as_double": {
"match_mapping_type": "long",
"mapping": {
"type": "double"
}
}
}
]
我是否应该使用copy_to
进行完整文档搜索?
1条答案
按热度按时间yvfmudvl1#
Tldr;
是的,如果你计划在很多领域进行大量搜索,你最好把所有这些领域都集中在一个领域。
解决方案: