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

Bill Mitchell edited comment on SOLR-5205 at 12/7/13 2:58 AM:
--------------------------------------------------------------

I missed that this Jira had already been opened when I created SOLR-5521.  

I tried the approach of changing the TermQuery.toString method, seen in the 
attached SOLR-5205.patch, and had it fail other tests, so I abandoned that 
approach and went with escaping the term text directly in the 
MoreLikeThisHandler, as was done in the attached SOLR-5205-trunk.patch.  (I'll 
admit, in my first attempt to fix this in TermQuery.toString, I was trying to 
protect the special characters by surrounding the entire term in quotes, and 
that did not work.)

As mentioned above by Shawn and Steve, beyond the id, there is the issue of 
needing to escape the terms (also brought up in a comment to SOLR-788).  
Instead of escaping these in the TermQuery.toString, the approach in the patch 
to SOLR-5521 is to escape these in MoreLikeThis.java, where the BooleanQuery is 
being built.   


was (Author: wtmitchell3):
I missed that this Jira had already been opened when I created SOLR-5521.  

I tried the approach of changing the TermQuery.toString method, seen in the 
attached SOLR-5205.patch, and had it fail other tests, so I abandoned that 
approach and went with escaping the term text directly in the 
MoreLikeThisHandler, as was done in the attached SOLR-5205-trunk.patch.  

As mentioned above by Shawn and Steve, beyond the id, there is the issue of 
needing to escape the terms (also brought up in a comment to SOLR-788).  
Instead of escaping these in the TermQuery.toString, the approach in the patch 
to SOLR-5521 is to escape these in MoreLikeThis.java, where the BooleanQuery is 
being built.   

> MoreLikeThis doesn't escape shard queries
> -----------------------------------------
>
>                 Key: SOLR-5205
>                 URL: https://issues.apache.org/jira/browse/SOLR-5205
>             Project: Solr
>          Issue Type: Bug
>          Components: MoreLikeThis
>    Affects Versions: 4.4
>            Reporter: Markus Jelsma
>             Fix For: 4.6
>
>         Attachments: SOLR-5205-trunk.patch, SOLR-5205.patch
>
>
> MoreLikeThis does not support Lucene special characters as ID in distributed 
> search. ID's containing special characters such as URL's need to be escaped 
> in the first place. They are then unescaped and get sent to shards in an 
> unescaped form, causing the org.apache.solr.search.SyntaxError exception.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to