elasticsearch mapping
程序员文章站
2022-07-05 13:59:27
...
settings
number_of_shards: 分片数,不可动态修改,尽量过度设置,以便扩展
number_of_replicas:副本数,可动态修改
analyzer:由filter、tokenizer组成
tokenizer:把一句换分词多个词条,决定了如何分词,词条数量。
filter:分词之后对每个词条进行过滤。
mapping
type:index type id决定一条文档,中的type
dynamic:可不可以动态生成表结构
_source.excludes:一条文档的原始数据(json)中不存储的字段列表,查询结果中也不包含。
store:下面没有列出,字段是否存储在索引中,默认是false。
{
"settings":{
"number_of_shards":"5",
"number_of_replicas":"1",
"analysis":{
"filter":{
"custom_pinyin_filter":{
"padding_char":" ",
"type":"pinyin",
"keep_separate_first_letter":"true",
"first_letter":"prefix"
}
},
"analyzer":{
"ik_pinyin_analyzer":{
"filter":[
"custom_pinyin_filter",
"word_delimiter"
],
"type":"custom",
"tokenizer":"ik_smart"
}
}
},
"search":{
"slowlog":{
"level":"debug",
"threshold":{
"fetch":{
"warn":"500ms",
"trace":"100ms",
"debug":"100ms",
"info":"200ms"
},
"query":{
"warn":"500ms",
"trace":"100ms",
"debug":"100ms",
"info":"200ms"
}
}
}
},
"indexing":{
"slowlog":{
"level":"debug",
"threshold":{
"index":{
"warn":"200ms",
"trace":"50ms",
"debug":"50ms",
"info":"100ms"
}
},
"source":"5000"
}
}
},
"mappings":{
"type":{
"dynamic":"false",
"_source":{
"excludes":[
"namePinyin"
]
},
"properties":{
"name":{
"type":"text",
"analyzer":"ik_smart"
},
"nameInitial":{
"type":"keyword"
},
"namePinyin":{
"type":"text",
"analyzer":"ik_pinyin_analyzer"
},
"other":{
"type":"keyword"
}
}
}
},
"aliases":{
}
}
上一篇: ES6入门
推荐阅读
-
Elasticsearch单机双节点集群部署实战
-
SpingBoot:整合Elasticsearch7.2.0
-
Elasticsearch 6.3.1、Head插件 安装及配置
-
MySQL 与 Elasticsearch 数据不对称问题解决办法
-
基于elasticsearch的自定义业务告警的设计思路
-
Elasticsearch 常用API
-
使用Python操作Elasticsearch数据索引的教程
-
Java代码解决ElasticSearch的Result window is too large问题
-
使用ElasticSearch6.0快速实现全文搜索功能的示例代码
-
SpringBoot+Elasticsearch