You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Munendra S N (JIRA)" <ji...@apache.org> on 2019/07/08 15:59:00 UTC

[jira] [Commented] (SOLR-6672) function results' names should not include trailing whitespace

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

Munendra S N commented on SOLR-6672:
------------------------------------

 [^SOLR-6672.patch] 
func string is computed [here|https://github.com/apache/lucene-solr/blob/ac209b637d68c84ce1402b6b8967514ce9cf6854/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java#L358]. Func parser consumes whitespace that follow the func query, hence extra spaces.

Above patch is without tests. Trimming computed func string would solve the issue but not sure if that is right way to do it

> function results' names should not include trailing whitespace
> --------------------------------------------------------------
>
>                 Key: SOLR-6672
>                 URL: https://issues.apache.org/jira/browse/SOLR-6672
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>            Reporter: Mike Sokolov
>            Priority: Minor
>         Attachments: SOLR-6672.patch
>
>
> If you include a function as a result field in a list of multiple fields separated by white space, the corresponding key in the result markup includes trailing whitespace; Example:
> {code}
> fl="id field(units_used) archive_id"
> {code}
> ends up returning results like this:
> {code}
>       {
>         "id": "nest.epubarchive.1",
>         "archive_id": "urn:isbn:97849D42C5A01",
>         "field(units_used) ": 123
>                           ^
>       }
> {code}
> A workaround is to use comma separators instead of whitespace
> {code} 
> fl="id,field(units_used),archive_id"
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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