Page 1 of 1

pisearch module - duplicates & show_in_menu issue [SOLVED]

Posted: Fri Apr 20, 2007 7:19 pm
by qbrix
So I went back to the pisearch module to see if I could fix this problem:
http://forum.cmsmadesimple.org/index.php/topic,11442.0.html

Fixing the duplicates was easy, I just appended the following at the SQL string (around line 324 for v1.7):
AND p.content ''

Then what I wanted was for the search to look inside pages that weren't in the menu. By default the pisearch module doesn't search these pages. So I removed the following from the SQL string:
AND c.show_in_menu = 1

But then everything went crazy. It showed a blank screen for the results, and sometimes it would give me a memory overflow error. It took me some time to understand what was wrong because first of all, its a simple SQL change, it shouldn't cause problems, and second none of the code is commented.

Long story short, apparently since the Pisearch page (which gives the results) wasn't in the menu, it wasn't included in the search, but now that it is it would cause the module to go bonkers. So I just explicitly filtered it out from the SQL string:
AND c.content_name 'Pisearch'

enjoy