lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Ingersoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-1071) spellcheck.extendedResults returns an invalid JSON response when count > 1
Date Mon, 27 Jul 2009 20:11:14 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735749#action_12735749
] 

Grant Ingersoll commented on SOLR-1071:
---------------------------------------

bq. When extendedResults is used, the suggestions are put in an array called "alternatives",
while when it's not used the suggestions are put in an array called "suggestion".

I debated the two different structures for a while and ultimately decided that people would
have to deal with it no matter what.  My suspicion was that people either use extendedResults
or not and that they don't mix them, but perhaps I was wrong.  Even if they do mix them, they
still need code for recognizing when there is a difference (unless they are just spitting
back out the raw, which means it doesn't matter anyway), so I don't know if it matters either
way.  Since this is out in the wild already, I think we should just fix the bug.  

> spellcheck.extendedResults returns an invalid JSON response when count > 1
> --------------------------------------------------------------------------
>
>                 Key: SOLR-1071
>                 URL: https://issues.apache.org/jira/browse/SOLR-1071
>             Project: Solr
>          Issue Type: Bug
>          Components: spellchecker
>    Affects Versions: 1.3
>            Reporter: Uri Boness
>            Assignee: Grant Ingersoll
>             Fix For: 1.4
>
>         Attachments: SpellCheckComponent_fix.patch, SpellCheckComponent_new_structure.patch,
SpellCheckComponent_new_structure_incl_test.patch
>
>
> When: wt=json & spellcheck.extendedResults=true & spellcheck.count > 1, the
suggestions are returned in the following format:
> "suggestions":[
> 	"amsterdm",{
> 	 "numFound":5,
> 	 "startOffset":0,
> 	 "endOffset":8,
> 	 "origFreq":0,
> 	 "suggestion":{
> 	  "frequency":8498,
> 	  "word":"amsterdam"},
> 	 "suggestion":{
> 	  "frequency":1,
> 	  "word":"amsterd"},
> 	 "suggestion":{
> 	  "frequency":8,
> 	  "word":"amsterdams"},
> 	 "suggestion":{
> 	  "frequency":1,
> 	  "word":"amstedam"},
> 	 "suggestion":{
> 	  "frequency":22,
> 	  "word":"amsterdamse"}},
> 	"beak",{
> 	 "numFound":5,
> 	 "startOffset":9,
> 	 "endOffset":13,
> 	 "origFreq":0,
> 	 "suggestion":{
> 	  "frequency":379,
> 	  "word":"beek"},
> 	 "suggestion":{
> 	  "frequency":26,
> 	  "word":"beau"},
> 	 "suggestion":{
> 	  "frequency":26,
> 	  "word":"baak"},
> 	 "suggestion":{
> 	  "frequency":15,
> 	  "word":"teak"},
> 	 "suggestion":{
> 	  "frequency":11,
> 	  "word":"beuk"}},
> 	"correctlySpelled",false,
> 	"collation","amsterdam beek"]}}
> This is an invalid json as each term is associated with a JSON object which holds multiple
"suggestion" attributes. When working with a JSON library only the last "suggestion" attribute
is picked up.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message