Scripted field How to retrieve recursive values

Hi !
I'm working with Kibana V5. I use mainly the Painless language with of scripted fields. In scripted fields, I use the "doc['field.keyword'].value" method to retrieve the value. In this project , there are many recursive fields. So several values that I retrieve.
In some cases, there are many recursive values but with the "doc['SgmStatus.keyword'].values" method , I can only get 1 value.
For example :
Display kibana discover :
result field : SgmStatus (SS , SS, SS)
result scripted fields : SgmStatus (SS)
The doc['SgmStatus.keyword'].length method return "1" while there are "3".
here is a displayed example :
SgmStatus (field)
FieldStatusResultat (Scripted fields)

How to retrieve recursive values in scripted field please ?
I will need a solution in "the scripted field" to get all the values of the "SgmStatus" recursive field even if the values are identical.
thanks in advance !!!

First, just to clarify, by "recursive values" you mean duplicate terms? Lucene dedups these terms in docvalues; there is no way around that. If you want to see how many original terms a field has, I suggest using an ingest processor to index this information into a separate field. Otherwise, your only option would be to use _source (which has the original json that was indexed), which is going to be considerably slower to access.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.