dbeast-co / Reindex

Reindex - application for visualize, optimize and automate your Elasticsearch reindex process
https://dbeast.co/reindex-for-elasticsearch
Apache License 2.0
11 stars 0 forks source link

Add support for nested fields for Date field in the Time oriented option. #16

Open pradeeppattamatta opened 1 year ago

pradeeppattamatta commented 1 year ago

Is your feature request related to a problem? Please describe. In the time-oriented reindex algorithm, if the Date field that is meant to be used is part of the nested object, there will be a "The date field doesn't exists" error.

Describe the solution you'd like The nested fields should be considered for time oriented algorithm.

Describe alternatives you've considered None.

Additional context None.

dbeast-co commented 1 year ago

For a clear understanding: when you talk about a "nested" object, do you mean the array of the object, that is defined as "nested" in the index mapping like:

{
  "mappings": {
    "properties": {
      "logs": {
        "type": "nested",
        "properties": {
          "timestamp": {
            "type": "date"
          },
          "field": {
            "type": "keyword"
          }
        }
      }
    }
  }
}

with the documents like:

{
  "logs": [
    {
      "timestamp": "2023-04-08T00:00:00",
      "field": "Some text"
    },
    {
      "timestamp": "2023-04-08T00:00:00",
      "field": "Some text"
    }
  ]
}

or the inner object with mapping like:

{
  "mappings": {
    "properties": {
      "logs": {
        "type": "nested",
        "properties": {
          "timestamp": {
            "type": "date"
          },
          "field": {
            "type": "keyword"
          }
        }
      }
    }
  }
}

and the document like:

{
  "log": {
    "timestamp": "2023-04-08T00:00:00",
    "field": "Some text"
  }
}