更新时间:2022-03-12 02:21:57
PUT index
{
"mappings": {
"_doc": {
"properties": {
"foo": {
"type": "integer",
"index": false
}
}
}
}
}
text:该属性在索引中存储了作为文档计分所需要的基本的因素,如果你索引的只是文本而不关注文本分数,那么你可以配置该索引不使用norms参数PUT index
{
"mappings": {
"_doc": {
"properties": {
"foo": {
"type": "text",
"norms": false
}
}
}
}
}
text:默认情况下该属性还存储了frequencies和positions两个属性,第一个属性在积分系统中被使用到,第二个在短语查询中使用到。如果你不需要执行短语查询,那么你可以禁用positions属性PUT index
{
"mappings": {
"_doc": {
"properties": {
"foo": {
"type": "text",
"index_options": "freqs"
}
}
}
}
}
PUT index
{
"mappings": {
"_doc": {
"properties": {
"foo": {
"type": "text",
"norms": false,
"index_options": "freqs"
}
}
}
}
}
PUT index
{
"mappings": {
"_doc": {
"dynamic_templates": [
{
"strings": {
"match_mapping_type": "string",
"mapping": {
"type": "keyword"
}
}
}
]
}
}
}