Skip to content
Advertisement

ElasticSearch painless determine that field was array in source document

Elasticsearch contains document like

JavaScript

With mapping

JavaScript

and

JavaScript

If i do

JavaScript

and

JavaScript

I get org.elasticsearch.index.fielddata.ScriptDocValues$Strings type for both fields.

How can i determine source field type? (I need get string length if field is simple string or size of array if field is array)

Advertisement

Answer

The correct painless expression to use is:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement