You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2007/02/21 16:28:05 UTC

[jira] Resolved: (SOLR-140) single quote in search query will break any sorts

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

Yonik Seeley resolved SOLR-140.
-------------------------------

    Resolution: Fixed

> single quote in search query will break any sorts
> -------------------------------------------------
>
>                 Key: SOLR-140
>                 URL: https://issues.apache.org/jira/browse/SOLR-140
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.1.0
>         Environment: SOLR nightly build 2007-02-01, but old builds as well.  Ubuntu 6.06 LTS server.  Tomcat 5.5.20
>            Reporter: John Kleven
>         Attachments: split_sort.txt
>
>
> Query strings that contain a single quote, properly escaped, break *as soon as you add a sort field*.
> For example,
> If  I want to search for the word ----   jam's   ---- 
> including the single quote, I can.  But as soon as I add a sort criteria to the URL, it breaks.
> Note: %27 is a single quote encoded for URI's
> Here's the examples....
> http://10.0.101.11:8080/forsale/select/?q=jam%27s    -- this works (i get ~20 hits back)
> http://10.0.101.11:8080/forsale/select/?q=jam%27s;score%20desc --- this doesn't (get 0 hits back)
> Seems that if the first query works, it shouldn't be breakable just by telling it explicitly to sort on score??  All other sorts break in this scenario as well ( i.e., price, etc).
> email rsp from Yonik:
> Hmmm, Solr tries to be smart about splitting the query from the sort
> specification.
> If it sees a semicolon inside quotes (single or double), or backslash
> escaped, then it will treat it as part of the query.
> An immediate workaround would be to query for "jam's" or jam\'s
> It would be helpful if you could open a JIRA issue for this.

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