I am using elastic search 2.4 and when I put documents on elasticsearch, the documents that contain different data types for some field are rejected by ES. This is because of the mapping I guess. I need to insert all the documents in ES, Is there any way to do that.
so, in this case, the first 2 documents are inserted in the ES successfully where the datatype of key.key1 is of type Integer. In the 3rd and other document the data type of that field is changed to string or may be JSON or other in further documents.
So it rejects because of key.key1 is not the type as expected.
Similarly, if I put the 3rd document first in the new index, It will reject the 1st, 2nd and all other documents that contain different data types for a particular field.
Yes, But here I need all the documents in the Index and all fields should be searchable.
There are no malformed fields, all fields are important and the JSON documents are generated dynamically. so there are data type issue in field.
That you can not index in Elasticsearch if you want all the fields searchable, so you will need to alter the structre. Elasticsearch allows mappings to be dynamically created but is not schema-less.
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.