[
https://issues.apache.org/jira/browse/SOLR-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13583014#comment-13583014
]
Jan Høydahl commented on SOLR-4480:
-----------------------------------
What should be the logical behavior of a single "+" or "-"? If eDisMax
discovers it as one of many words, it is treated as whitespace (I think by
mistake since it is caught by the MUST[+]/NOT[-] logic).
So the least surprising behavior would perhaps be to interpret it the same way
- leadning to an empty "q" and fallback to "q.alt".
Another option would be to detect and escape with "\" to match literally.
However for most eDisMax uses you would not expect or want this. It would also
be inconsistent with behavior with multi term search. If you like literal match
you can always escape yourself.
> EDisMax parser blows up with query containing single plus or minus
> ------------------------------------------------------------------
>
> Key: SOLR-4480
> URL: https://issues.apache.org/jira/browse/SOLR-4480
> Project: Solr
> Issue Type: Bug
> Components: query parsers
> Reporter: Fiona Tay
> Priority: Critical
> Fix For: 4.2
>
>
> We are running solr with sunspot and when we set up a query containing a
> single plus, Solr blows up with the following error:
> SOLR Request (5.0ms) [ path=#<RSolr::Client:0x4c7464ac> parameters={data:
> fq=type%3A%28Attachment+OR+User+OR+GpdbDataSource+OR+HadoopInstance+OR+GnipInstance+OR+Workspace+OR+Workfile+OR+Tag+OR+Dataset+OR+HdfsEntry%29&fq=type_name_s%3A%28Attachment+OR+User+OR+Instance+OR+Workspace+OR+Workfile+OR+Tag+OR+Dataset+OR+HdfsEntry%29&fq=-%28security_type_name_sm%3A%28Dataset%29+AND+-instance_account_ids_im%3A%282+OR+1%29%29&fq=-%28security_type_name_sm%3AChorusView+AND+-member_ids_im%3A1+AND+-public_b%3Atrue%29&fq=-%28security_type_name_sm%3A%28Dataset%29+AND+-instance_account_ids_im%3A%282+OR+1%29%29&fq=-%28security_type_name_sm%3AChorusView+AND+-member_ids_im%3A1+AND+-public_b%3Atrue%29&q=%2B&fl=%2A+score&qf=name_texts+first_name_texts+last_name_texts+file_name_texts&defType=edismax&hl=on&hl.simple.pre=%40%40%40hl%40%40%40&hl.simple.post=%40%40%40endhl%40%40%40&start=0&rows=3,
> method: post, params: {:wt=>:ruby}, query: wt=ruby, headers:
> {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path:
> select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: ,
> read_timeout: } ]
> RSolr::Error::Http (RSolr::Error::Http - 400 Bad Request
> Error: org.apache.lucene.queryParser.ParseException: Cannot parse '':
> Encountered "<EOF>" at line 1, column 0.
> Was expecting one of:
> <NOT> ...
> "+" ...
> "-" ...
> "(" ...
> "*" ...
> <QUOTED> ...
> <TERM> ...
> <PREFIXTERM> ...
> <WILDTERM> ...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]