[ 
https://issues.apache.org/jira/browse/SOLR-2606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-2606:
---------------------------

    Attachment: SOLR-2606.patch

bq. My money's on this:

Mike: close, but that's kind of a red herring.

If you look at SOLR-1297 and the patch I mentioned you'll note that since using 
java identifier rules for field names is considered the common case, that test 
is done first as a short circuit (like the comment says) and function parsing 
is done after it -- but if *that* fails then the logic i mentioned was suppose 
to kick in (by catching the exception and then doing the quick "is what's left 
a field name?" check)

after reviewing it a bit, i realized that I was kind of stupid when i added the 
"is what's left a field name?" backcompat work in SOLR-1297, and overlooked 
some error cases:

1) Other types of Exceptions can be thrown by the function parsing besides 
ParseException (notably: SolrException and NumberFormatException in this test)
2) the "field" variable wasn't being reset to null if it was determined that 
getId(null) had parsed a valid id but that id hadn't used up enough of the sort 
spec (ie: wasn't followed by whitespace).

Attached patch fixes these oversights and fixes the tests in the previous patch.

it would be nice to have some more tests to be sure i'm still not missing 
something stupid.

> Solr sort no longer works on field names with some punctuation in them
> ----------------------------------------------------------------------
>
>                 Key: SOLR-2606
>                 URL: https://issues.apache.org/jira/browse/SOLR-2606
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 3.1, 3.2
>         Environment: Linux
>            Reporter: Mitsu Hadeishi
>         Attachments: SOLR-2606.patch, SOLR-2606.test.only.patch
>
>
> We just upgraded from Solr 1.4 to 3.2. For the most part the upgrade went 
> fine, however we discovered that sorting on field names with dashes in them 
> is no longer working properly. For example, the following query used to work:
> http://[our solr server]/select/?q=computer&sort=static-need-binary+asc
> and now it gives this error:
>     HTTP Status 400 - undefined field static
>     type Status report
>     message undefined field static
>     description The request sent by the client was syntactically incorrect 
> (undefined field static).
> It appears the parser for sorting has been changed so that it now tokenizes 
> differently, and assumes field names cannot have dashes in them. However, 
> field names clearly can have dashes in them. The exact same query which 
> worked fine for us in 1.4 is now breaking in 3.2. Changing the sort field to 
> use a field name that doesn't have a dash in it works just fine.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to