i have many fields in a index. but if i have a new field in an index and the data come in format 'yyyy/MM/dd' the elastic auto map this field as date format but in next value in this field could be text.
i want to disable the auto mapping and set new fields as text type.
how can i do that?
If you do that, you'll have to provide an explicit set of mappings before indexing any data. Alternatively, you could leave dynamic mappings enabled but set the mapping for the date field up-front.
Dynamic mappings are only applied to fields that are currently unmapped... so if you provide the correct mapping at the beginning that will be used instead of dynamic mapping
Following up, one of my colleagues suggested a better way which I had forgotten. You can also disable date detection in text fields or specify how detected date should be indexed using dynamic templates.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.