在ElasticSearch查询中存储项目

时间:2018-10-19 02:07:01

标签: elasticsearch grouping bucket

我想存储从搜索查询中获得的数据,并且不确定应该采用哪种策略。

我考虑过对其进行充实,以便以后再进行存储,这样行得通吗?如果是这样,您将如何做?

类似于以下在我添加了group标签的地方:

发件人

{
  ...
  "hits": {
    "total": ...,
    "hits": [
      {
        "_source": {
          "type": "Plane",
          "brand": "Airbus",
        }
      },
      {
        "_source": {
          "type": "Car",
          "model": "Toyota",
        }
      },
      {
        "_source": {
          "type": "Bike",
          "model": "Yamaha",
        }
      }

收件人

{
  ...
  "hits": {
    "total": ...,
    "hits": [
      {
        "_source": {
          "group": "Fly",
          "type": "Plane",
          "brand": "Airbus",
        }
      },
      {
        "_source": {
          "group": "Drive",
          "type": "Car",
          "model": "Toyota",
        }
      },
      {
        "_source": {
          "group": "Drive",
          "type": "Bike",
          "model": "Yamaha",
        }
      }

谢谢!

0 个答案:

没有答案