You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/01/07 16:33:00 UTC

[jira] [Commented] (SOLR-12539) JSON Facet shorthand list syntax (Comma seperated list) doesn't trim leading/trailing spaces -- affects range "other" and "include" options (probably more)

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

ASF subversion and git services commented on SOLR-12539:
--------------------------------------------------------

Commit d7fd3d8c20e862048e749528f09fae8087a03509 in lucene-solr's branch refs/heads/master from Munendra S N
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=d7fd3d8 ]

SOLR-12539: handle extra spaces in JSON facet shorthand syntax


> JSON Facet shorthand list syntax (Comma seperated list) doesn't trim leading/trailing spaces -- affects range "other" and "include" options (probably more)
> -----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-12539
>                 URL: https://issues.apache.org/jira/browse/SOLR-12539
>             Project: Solr
>          Issue Type: Bug
>          Components: Facet Module
>            Reporter: Chris M. Hostetter
>            Assignee: Munendra S N
>            Priority: Major
>         Attachments: SOLR-12539.patch
>
>
> when doing a {{type: range}} JSON Facet request, if you use the supported "comma seperated string" syntax instead of a true JSON List for specifing options like {{other}} or {{include}} then any whitepsace in your string is left in and breaks the parsin of those options.
> This probably affects other features of JSON Faceting that also support this comma seperated string shorthand (tag exclusions?)
> ----
> This works...
> {code}
> bin/solr -e techproducts
> ...
> $ curl http://localhost:8983/solr/techproducts/query -d 'q=*:*&rows=0&omitHeader=true&json.facet=
> {x:{type:range,
>     field:price,
>     start:0,
>     end:100,
>     gap:20,
>     other:"before,after"}}'
> {
>   "response":{"numFound":32,"start":0,"docs":[]
>   },
>   "facets":{
>     "count":32,
>     "x":{
>       "buckets":[{
>           "val":0.0,
>           "count":5},
> ...
>       "before":{
>         "count":0},
>       "after":{
>         "count":9}}}}
> {code}
> This doesn't (note the subtle amount of whitespace in the error message)...
> {code}
> $ curl http://localhost:8983/solr/techproducts/query -d 'q=*:*&rows=0&omitHeader=true&json.facet=
> {x:{type:range,
>     field:price,
>     start:0,
>     end:100,
>     gap:20,
>     other:"before, after"}}'
> {
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","java.lang.IllegalArgumentException"],
>     "msg":" after is not a valid type of 'other' range facet information",
>     "code":400}}
> {code}
> ...exagerated...
> {code}
> $ curl http://localhost:8983/solr/techproducts/query -d 'q=*:*&rows=0&omitHeader=true&json.facet=
> {x:{type:range,
>     field:price,
>     start:0,
>     end:100,
>     gap:20,
>     other:"before,                           after"}}'
> {
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","java.lang.IllegalArgumentException"],
>     "msg":"                           after is not a valid type of 'other' range facet information",
>     "code":400}}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org