0

I have a dynamic template where my string mapping is set up as below:

            {
                "string_fields": {
                    "match_mapping_type": "string",
                    "mapping": {
                        "type": "text",
                        "fields": {
                            "numeric": {"type": "double", "ignore_malformed": True},
                            "date": {"type": "date", "ignore_malformed": True},
                        },
                    },
                }
            }

Now, I only want the .numeric and .date sub-fields to be generated if the text is double or date respectively. I am confused if in the above case it gets unnecessarily generated for all my ingested strings or does ES handle it smartly. How does it make its decision?

ES Version 7.10

Ankit
  • 45
  • 1
  • 7
  • It's very easy to test that. What happens if you try and see what happens? – Val Nov 17 '20 at 05:46
  • It's a strange use case. I think it would be cleaner to just set the destination field with the good datatype and use a pipeline with some convert processors into your ingestion process. https://www.elastic.co/guide/en/elasticsearch/reference/current/convert-processor.html – Jaycreation Nov 17 '20 at 11:15

0 Answers0