首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticSearch -基于嵌套对象和获取文档的查询

ElasticSearch -基于嵌套对象和获取文档的查询
EN

Stack Overflow用户
提问于 2016-10-21 11:20:37
回答 1查看 25关注 0票数 0

我有下一份文件:

代码语言:javascript
复制
{
  id: 222,
  email: user@user.com,
  experiences: [
    {
      id: 3,
      position: "Programmer",
      description: "Programming things"
      init_date: "1990-01-01",
      end_date: "1999-05-11"
    },
    {
      id: 4,
      position: "Full Stack Developer",
      description: "Programming things"
      init_date: "1999-01-01",
      end_date: "2008-05-11"
    },
    {
      id: 7,
      position: "Gardener",
      description: "Taking care of flowers"
      init_date: "2009-01-01",
      end_date: "2015-05-11"
    },
  ]
}

所以,我想做下一个过滤器:关键字:编程,体验年:> 3

经验年应该是与关键字匹配的经验之和。

只能在一个查询中执行吗?

EN

回答 1

Stack Overflow用户

发布于 2016-10-22 03:58:39

在索引本身时,您添加了一个额外的字段以供体验,而不是使用查询进行计算。它也会更快,更容易查询。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40175359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档