这篇文章主要介绍Elasticsearch Mapping的示例代码,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

创新互联专注为客户提供全方位的互联网综合服务,包含不限于成都网站设计、成都做网站、外贸网站建设、泗县网络推广、小程序开发、泗县网络营销、泗县企业策划、泗县品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供泗县建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com
Elasticsearch Mapping示例
PUT my_index { // 创建 my_index索引
"mappings": {
"user": { // 创建名称为user的type
"_all": { "enabled": false }, //Disable the _all meta field for the user mapping type
"properties": {
"title": { "type": "string" },
"name": { "type": "string" },
"age": { "type": "integer" }
}
},
"blogpost": {
"properties": {
"title": { "type": "string" },
"body": { "type": "string" },
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"created": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}
}}type: 字段的数据类型,例如 string 和 date
a simple type like
string,date,long,double,booleanorip.a type which supports the hierarchical nature of JSON such as
objectornested.or a specialised type like
geo_point,geo_shape, orcompletion.
index: 字段是否应当被当成全文来搜索(analyzed),或被当成一个准确的值(not_analyzed),还是完全不可被搜索(no)
analyzer: 确定在索引和或搜索时全文字段使用的分析器。
以上是“Elasticsearch Mapping的示例代码”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联行业资讯频道!
网页题目:ElasticsearchMapping的示例代码
文章源于:http://www.jxjierui.cn/article/gpcdds.html


咨询
建站咨询
