zoukankan      html  css  js  c++  java
  • ES mapping可以修改include_in_all,也可以修改index_options,norm,但是无法修改_all属性!

    ES mapping可以修改include_in_all,也可以修改index_options,norm,但是无法修改_all属性!


    curl -XPOST "http://localhost:9200/productindex" curl -XGET "http://localhost:9200/productindex/_mapping?pretty" curl -XPOST "http://localhost:9200/productindex/product/_mapping?pretty" -d ' { "product": { "properties": { "title": { "type": "string", "include_in_all": true, "index_options": "offsets", "store": "yes" }, "description": { "type": "string", "index": "not_analyzed" }, "price": { "type": "double" }, "onSale": { "type": "boolean" }, "type": { "type": "integer" }, "createDate": { "type": "date" } } } } ' curl -XGET "http://localhost:9200/productindex/_mapping?pretty" curl -XPOST "http://localhost:9200/productindex/product/_mapping?pretty" -d '{ "product": { "properties": { "amount":{ "type":"integer" } } } }' curl -XPOST "http://localhost:9200/productindex/product/_mapping?pretty" -d '{ "product": { "properties": { "title":{ "type":"string" , "norms" : { "enabled" : false }, "include_in_all": false, "index_options": "docs", "store": "yes" } } } }' 可以看到,是可以直接修改include_in_all和index_options、norms属性的!
    注意是没有办法修改_all属性的! curl -XPOST "http://localhost:9200/productindex/product/_mapping?pretty" -d '{ "product": { "_source": { "enabled": false }, "_all": { "enabled": false } } }' 会提示: MergeMappingException: Merge failed with failures {[mapper [_all] enabled is false now encountering true]}
  • 相关阅读:
    Scheduler踩坑记录
    关于RedisTemplate的map存储踩坑记录
    关于HashMap的加载因子相关理解
    Mybatis 分页插件PageHelper 遇坑
    Linux 下 Mysql忘记密码重置
    Eclipse MAT和jvisualvm分析内存溢出
    使用jdk自带工具jvisualvm 分析内存dump文件
    EUREKA 删除 or 强制下线/上线 实例
    Idea 远程调试jenkins 项目
    spring 事务传播行为类型
  • 原文地址:https://www.cnblogs.com/bonelee/p/6856721.html
Copyright © 2011-2022 走看看