Elasticsearch query

I have a field called @editors in my index . It has multiple values like , i would like only show the last editor name in last_editors field .
I want to write a query where i can only fetch the the last editor name in each _id(document)

The number of editors different in each document

  1. "@editors": "sunny", "mandy", "krish"
  2. "@editors": "sony"
    3."@editors": "maya", "firta"
    4."@editors": "riya", "viru", "mandy", "giri"

Please suggest me a query which can check if it is a single value it returns the value as it is if it is mutiple it will return the last value name in that field

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