arrayselasticsearchelasticsearch-mapping

How to know if a field is an array in elasticsearch?


I would like to know which field are array in my index in ES 6.8.3.

When I retrieve the mapping of the index via Kibana API :

GET structured_data/_mapping

I only get the kind of the value within the array.

It is a problem because when I want to load the data from spark, if there is an array field, I need to specify it otherwise it will raise an error.

Thanks in advance,

Louis


Solution

  • there is no dedicated data type array in Elasticsearch. Look at this link you don't have to specify anything specific in the mapping to store an array of values. Look in your source data if that contains an array, ES should take that array, given all the data inside that array is same data type