java - Unmarshall Solr Spellcheck results from JSON -


i have solr server working, including effective spellcheck component in main query parser. i'm building set of json unmarshalling classes (in java) convert query responses data other elements of our webapp interpret.

problematically, query tokens returned json properties. these dynamic , unable predetermined in code. complicated fact other 2 results on same level cannot parsed similar objects, 1 boolean determination of correct spelling, , other top spelling suggestion produced collation.

while ignore them, top element of collator presents effective spelling suggestion, nice able unmarshal these elements, include spelling suggestions each specific term.

is there way pass in query tokens (eg, pass in args @ query time interpreted json properties) solr json unmarshaller property names type of java object build parse these suggestions?

if not, don't need them. seems tiny bit absurd construct json that's unparseable pojo.

here's example of spellcheck's json output query "artificail intelligrnce":

"spellcheck": {     "suggestions": [         "artificail", {             "numfound": 3,             "startoffset": 1,             "endoffset": 11,             "origfreq": 0,             "suggestion": [                 {                     "word": "artificial",                     "freq": 1                 },                 {                     "word": "a r t if c l",                     "freq": 57                 },                 {                     "word": "certificate",                     "freq": 1                 }             ]         },         "intelligrnce", {             "numfound": 3,             "startoffset": 12,             "endoffset": 24,             "origfreq": 0,             "suggestion": [                 {                     "word": "intelligence",                     "freq": 3                 },                 {                     "word": "in tell g r nc e",                     "freq": 101                 },                 {                     "word": "inheritance",                     "freq": 1                 }             ]         },         "correctlyspelled", false,         "collation", [             "collationquery", "\"artificial intelligence\"",             "hits", 1,             "misspellingsandcorrections", [                 "artificail", "artificial",                 "intelligrnce", "intelligence"]]] }, 

thanks!


Comments

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -