Longest Hierarchy Search

Hi Team,

So, I am using ESv.6.4. and my requirement is, I want to search the longest matched hierarchy in search results and break the path from the nearest separator.

my data is

India/Up/Noida
India/Delhi/Gurugram
India/Delhi/NewDelhi
India/RJ

case 1) when user search "India"
O/p: "India"

case 2) when user search "UP"
O/p: "India/Up"

case3) when user search "Delhi"
O/p: "India/Delhi/NewDelhi"

case4) when user search "U"
O/p: "India/Delhi/Gurugram"
"India/Up"

Is there any query that fulfill my requirement

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