当前位置: 首页 > news >正文

elasticsearch存入数据嵌入式数据解决扁平化查询问题

        嵌套查询搜索嵌套的字段对象,就像它们作为单独的文档被索引一样。如果对象与搜索匹配,嵌套查询将返回根父文档。

官方文档:https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html

1.在创建索引时进行将type标记为‘nested’

PUT product
{"mappings": {"properties": {"catelogName":{"type": "keyword","index": false,"doc_values": false},"attrs":{"type": "nested","properties":{"attiId":{"type":"long"},"attrName":{"type":"keyword","index": false,"doc_values": false},"attrValue":{"type":"keyword"}}}}}
}

2.修改映射type类型

PUT /my-index-000001
{"mappings": {"properties": {"obj1": {"type": "nested"}}}
}

 


http://www.mrgr.cn/news/14923.html

相关文章:

  • 告别繁琐,拥抱简单!用户好评如潮的录屏软件
  • app抓包环境的搭建详细教程
  • chapter09-项目——(房屋出租系统)——day11
  • vue打印数据
  • 深入理解DPO(Direct Preference Optimization)算法
  • #C++ 笔记三
  • 最大子数组(有限制)
  • 【BPF之旅】认识eBPF
  • cola_os学习笔记(下)
  • mysql8.0查询等级排名可使用窗口函数,那5.7的版本呢?
  • 设计模式-简单工厂模式工厂方法模式
  • cesium模型加载-点击-高亮
  • 自定义全局变量在uniapp的Vuex应用
  • 数字三角形
  • BITCN合集(BITCN 、BITCN-GRU、BITCN-BIGRU、BITCN-LSTM、BITCN-BILSTM、BITCN-SVM)
  • 装饰器(Decorators)的实现
  • 基于RK3588+MCU智能清洁车应用解决方案
  • erlang学习:用OTP构建系统2,警报管理
  • CTF密码学小结
  • 面试题集锦:数据库