Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
4.2.1
-
None
-
None
Description
When the compared document's unique id is negative, the MoreLikeThis component fails to generate a valid query to pass to each shard, as the generated query does not encapsulate the item's negative id with quotes. In our case, we are adding documents with a negative id as temporary beans, used just for the MLT query, which will be deleted later.
You can see this with a rather simple MLT query:
http://lga-sppsolrprod01.pulse.prod/solr/rawContents/select?mlt=true&q=itemId:-1578997856&mlt.fl=text&mlt.count=100
where the returned response shows:
<response><lst name="responseHeader"><int name="status">400</int><int name="QTime">3</int><lst name="params"><str name="mlt.count">100</str><str name="mlt.fl">text</str><str name="q">itemId:1578997856</str><str name="mlt">true</str></lst></lst><lst name="error"><str name="msg">org.apache.solr.search.SyntaxError: Cannot parse 'itemId:-1578997856': Encountered " "" "- "" at line 1, column 7.
Was expecting one of:
<BAREOPER> ...
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
<REGEXPTERM> ...
"[" ...
"{" ...
<LPARAMS> ...
<NUMBER> ...
</str><int name="code">400</int></lst></response>
Attachments
Attachments
Issue Links
- duplicates
-
SOLR-5205 MoreLikeThis doesn't escape shard queries
- Open