The mlt component is unable to get a correct result from the Solr 4.x service.
The 'q' parameter for the 'more like this' query is based upon a 'apachesolr_document_id' which is a combination of a unique site-hash, the entity type and the unique id delimited by forward slashes.
Since the latest Lucene version the forward slash has become a special character and needs to be escaped. https://issues.apache.org/jira/browse/LUCENE-3982
I've created a patch which adds the forward slash to the escape characters list and actually uses that provided function (I couldn't find any prior usage?).
In order not to break anything I might not be aware of the escaping will only occur on '?q:id=VALUE-TO-ESCAPE' alike queries. If we were to escape every 'q' parameter, we would lose phrase searches and so on...
There'll probably be a better place to perform such an 'escape' check, so please review.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | apachesolr-solr4-escape-characters-mlt-1868434-2.patch | 1.75 KB | smokris |
Comments
Comment #2
smokrisWorks for me. Thanks, Yannick Van Gansen!
Re-rolled to apply to latest 7.x-1.x-dev (and 7.x-1.6).
Comment #3
nick_vhis this only the case for the identifier? Can you show some documentation where this is from? Patch looks ok