It's good to point out here that Elasticsearch will flatten your document. In your example, indexing the following document would have the same result:
{
"field1": {
"val": [
1,
2,
3,
4
]
}
}
If you want to index arrays of objects, and really treat them as separate objects, you may want to consider using nested types instead. Check the docs for an explanation. Your mapping would become:
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.