[
https://issues.apache.org/jira/browse/SOLR-10522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15998296#comment-15998296
]
James Dyer commented on SOLR-10522:
-----------------------------------
I do not think SpellCheckComponent (or any other part of Solr) should have to
do anything special to cater to the various json formats we now support. In my
opinion, the response writer should never output invalid json, and it should be
its responsibility to complain when it encounters something it cannot support.
If it was fixed centrally, it would make the output more consistent as similar
scenarios would be handled the same way throughout the application. This would
also be a bit more future-proof because it isn't exactly clear that the Solr
objects that hold response data can product invalid responses, and it doesn't
seem likely every new output would be tested against all of these formats.
I think a better move forward would be:
1. revert SOLR-9972.
2. open a ticket that arrntv can sometimes product invalid json, using this as
an example use-case. Having it reject unsupportable objects would be a valid
first step.
3. Maybe in 7.x revamp the response objects to be more
response-writer-friendly, less xml-centric ?
> Duplicate keys in "collations" object with JSON response format
> ---------------------------------------------------------------
>
> Key: SOLR-10522
> URL: https://issues.apache.org/jira/browse/SOLR-10522
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: spellchecker
> Affects Versions: 6.5
> Reporter: Nikita Pchelintsev
> Assignee: James Dyer
> Priority: Minor
>
> After upgrading Solr 6.3 -> 6.5 I've noticed a change in how json response
> writer outputs "collations" response key when spellchecking is enabled
> (wt=json&json.nl=arrarr)
> Solr 6.3:
> "collations":
> [
> ["collation",{
> "collationQuery":"the",
> "hits":48,
> "maxScore":"30.282",
> "misspellingsAndCorrections":
> [
> ["thea","the"]]}],
> ["collation",{
> "collationQuery":"tea",
> "hits":3,
> "maxScore":"2.936",
> "misspellingsAndCorrections":
> [
> ["thea","tea"]]}],
> ...
> Solr 6.5:
> "collations":{
> "collation":{
> "collationQuery":"the",
> "hits":43,
> "misspellingsAndCorrections":
> [
> ["thea","the"]]},
> "collation":{
> "collationQuery":"tea",
> "hits":3,
> "misspellingsAndCorrections":
> [
> ["thea","tea"]]},
> ...
> Solr 6.5 outputs object instead of an array, and it has duplicate keys which
> is not valid for JSON format.
> Any help is appreciated.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]