Low Search 4.1.1 returning Mysql error on certain queries
Hey all,
I've bumped into an issue with Low Search version 4.1.1 on ExpressionEngine 2.9.3. When I search for certain terms I get the following error:
-------------------------------
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3
SELECT 'channel_id', IF(search_results_url='', channel_url, search_results_url) AS url FROM ('exp_channels') WHERE 'channel_id' IN ()
Filename: /Users/jesseschutt/Sites/sample/third_party/low_search/filters/keywords/lsf.keywords.php
Line Number: 1201
-------------------------------
Does anyone have an idea how I might resolve this?
Replies
Low 16 Apr 2015 22:26
Can you share your forms and results tags please? You can use pastie.org for large chunks of code.
Also, enable the template debugger and copy paste all lines that mention Low Search or low_search here, for a search that does produce results.
Jesse Schutt 17 Apr 2015 00:04
Thanks Low!
Search Form: http://pastie.org/10097043
Results Tag: http://pastie.org/10097045
Debugger: http://pastie.org/10097052
Low 17 Apr 2015 07:49
Can you try the following:
- Move the search_mode parameter from the Form to the Results tag, and rename it keywords:mode;
- Move the collection parameter from the Form to the Results tag.
Does the error still occur then?
Also, for what search terms does the error occur?
Jesse Schutt 17 Apr 2015 13:57
With your suggestions in place I'm still getting the same error for the search term "Contextualization for North Kivu (DRC)". If I shorten it to "Contextualization for North Kivu" I still get the error. I thought maybe the parenthesis was causing it.
If I shorten it all the way to "Contextualization for" then I get results.
BTW - "Contextualization for North Kivu (DRC)" is a title of an entry in the "jobs" channel.
Low 17 Apr 2015 14:04
I'll need to take a look myself. Please send SuperAdmin login credentials to hi at gotolow dot com if you can.
Low 18 Apr 2015 07:42
Looks like it's a conflict with Transcribe. Its extension fires before LS does, and apparently returns empty rows. Then, in LS, the method to alter search results is called when there are no results to give. The method shouldn't have been called in the first place... Or, Transcribe shouldn't return an empty array, I think.
I changed the priority of the LS hook to fire before Transcribe, and now it works again.
Jesse Schutt 20 Apr 2015 11:37
Thanks for finding a solution! Do you know which file(s) you modified? I need to collect them for the production environment.
Thank you
Low 20 Apr 2015 11:43
I didn't change any files, just a the priority value of the Low Search extension hook that uses the 'channel_entries_query_result' hook. You can go ahead and change that to 1 on the production env.