ElasticSearch命令增加字段总结

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ElasticSearch命令增加字段总结相关的知识,希望对你有一定的参考价值。

1、建立一个String类型的字段

curl -XPUT http://192.168.46.163:9200/t_risk_case/_mapping/t_risk_case?pretty -d ‘{"properties":{"uuid":{"type":"string"}}}‘ 

2、建一个嵌套型的字段

curl -XPUT http://192.168.46.163:9200/t_risk_case/_mapping/t_risk_case?pretty -d ‘{"properties":{"case_details":{"type":"nested"}}}‘

3、建一个不做分词的字段

 curl -XPUT http://192.168.46.163:9200/t_risk_case/_mapping/t_risk_case?pretty  -d ‘{"properties":{"title":{"type":"string","index":"not_analyzed"}}}‘

 

以上是关于ElasticSearch命令增加字段总结的主要内容,如果未能解决你的问题,请参考以下文章