SyntaxError: Cannot parse '(())'

./solr_log_20150619_1509:ERROR - 2015-06-19 09:50:55.986; [   ] org.apache.solr.common.SolrException; org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Cannot parse '(())': Encountered " ")" ") "" at line 1, column 2.
./solr_log_20150619_1509:Caused by: org.apache.solr.search.SyntaxError: Cannot parse '(())': Encountered " ")" ") "" at line 1, column 2.
./solr_log_20150619_1509:INFO  - 2015-06-19 09:50:55.987; [   ] org.apache.solr.core.SolrCore; [] webapp=/solr path=/select params={sort=bs_search_api_aggregation_13+desc,+score+desc,+fs_search_api_aggregation_3+desc,+bs_sticky+desc&fl=item_id,score&start=0&q=house&qf=tm_search_api_aggregation_1^3.0&json.nl=map&wt=json&fq=(())&fq=index_id:"product_display"&fq=hash:jw4ziu&rows=30} status=400 QTime=4

Comments

fortis’s picture

there is problem
$fq[] = count($q) == 1 ? reset($q) : '((' . implode(')' . $sep . '(', $q) . '))';
we need check that $q not empty
quickfix attached

fortis’s picture

Version: 7.x-1.x-dev » 7.x-1.8
fortis’s picture

Status: Active » Needs review
thepanz’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Works fine, thanks!

drunken monkey’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new863 bytes

Thanks a lot for reporting this! You're right, we should definitely check for this (even though there's gotta be something strange about the incoming query then, too).
Your patch looks also good and seems to work fine!
However, I think this one is a bit more elegant, does it also work for you?

fortis’s picture

Status: Needs review » Reviewed & tested by the community

Yes, it works, thank you!

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

OK, good to hear. Thanks for testing, and thanks again for your work before!
Committed!

  • drunken monkey committed f72c5e6 on 7.x-1.x authored by fortis
    Issue #2513314 by fortis, drunken monkey: Fixed error for empty filters.
    
fortis’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

c-logemann’s picture