PDA

View Full Version : Massage SOLR json into a store.



scaddenp
5 Sep 2011, 3:45 PM
I have json returned from SOLR which looks like this:

{"response":
{
"docs":[
{"id":"location/a.html", "text":["whatever..."] },
{"id":"location/b.html", "text":["whatever more..."] }, ....
]
},
"highlighting":{
"location/a.html":{"text":["whatever with emphasis"]},
"location/b.html":{"text":["more whatever with emphasis"]},
...
},
ie the id field in docs is the field name in highlighting.

I want to consume this into a store.

What I want in the json store is two fields -
the "id" from docs and the matching "text" from highlighting.

Is there a clever way to achieve this (other than writing my own custom jsonreader?)