【问题标题】:how to add timestamp to child document when indexing in elasticsearch在elasticsearch中索引时如何为子文档添加时间戳
【发布时间】:2019-11-30 19:07:31
【问题描述】:

对于Elasticsearch中的一个父子关系索引,案例中的父子文档不是同时添加的。父文档存在后,可以添加新的子文档。

按照Automatically adding a timestamp to documents 中描述的步骤,发现ingest_timestamp 字段已添加到父文档中,但它不适用于子文档索引。

PUT _ingest/pipeline/my_timestamp_pipeline
{
  "description": "Adds a field to a document with the time of ingestion",
  "processors": [
    {
      "set": {
        "field": "ingest_timestamp",
        "value": "{{_ingest.timestamp}}"
      }
    }
  ]
}

给子文档增加创建时间方便吗?

【问题讨论】:

    标签: elasticsearch timestamp parent-child


    【解决方案1】:

    这是在 go 中的无效使用,但错误没有打印出来。打印错误后,发现索引实际上并没有发生。解决问题后,索引现在正在工作。该管道适用于父文档和子文档。

    【讨论】:

      猜你喜欢
      • 2015-02-16
      • 1970-01-01
      • 2015-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多