How to use elastic search for storing & fetching document as json

I am working on ElasticSearch for the purpose of storing & fetching data as json. The problem is ES treats json as text/string when I use search/highlight function and does not complete my requirement i.e. to get all the parents of stored json in the search result. For example if I have a json like this:

{"jsonfile.htm":{"Headingtag":"100129","Sectiontext":{"part i":{"Headingtag":"p1","Sectiontext":{"Random Heading I":{"Sectiontext":"Impossible considered invitation him men instrument saw celebrated unpleasant."},"Random Heading II":{"Sectiontext":"Prevailed discovery immediate objection of ye at."}}}}}}

When we use search or highlight function for "celebrated" text, it gives me the result like this:

[highlight] => Array ( [detail] => Array ( [0] => ":{"Random Heading I":{"Sectiontext":"Impossible considered invitation him men instrument saw celebrated ) )

It consider json as string and ignores the parent child relation. Can anyone help me to find out how to fetch all the searched text parents in the result?

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