Page 1 of 1

Extending quicksearch

Posted: Sun Apr 02, 2006 9:17 pm
by alexmloveless
I want to extend quicksearch so that it searches comments aswell as entries. At the moment I can't even find the code that powers the search!

So, can someone point me in the direction of the search code, and/or give me some direction on how to achieve extending quicksearch.

Thanks!

Alex

Posted: Mon Apr 03, 2006 3:35 am
by judebert
Garvin may be able to give you more detailed information about extending QuickSearch, but I can direct you to the appropriate file: check out include/plugins_internal.inc.php.

Posted: Mon Apr 03, 2006 8:42 am
by DarKRaveR
Since I am tweaking on quicksearch too and it certainly is a bad idea to change core files, you might want to do the following:

Grab the quicksearch class from the file posted already, put it in a new file and directory in the plugins folder, give it a new name etc. and start from there ...

Should give you the necessary playground for messing around and extending it ...

if the extensions are interesting, the developers might merge in teh default branch ... but aside from that, I'd rather develop a seperate plugin first ...

Posted: Mon Apr 03, 2006 10:49 am
by garvinhicking
Hi!

The actual routine that does the search is a s9y core function: serendipity_searchEntries(), found in include/functions_entries.inc.php.

It does allow some plugin API hooks which should do the trick to search within comments! It's only a matter of a new LEFT JOIN, just like multilingual search has been introduced some time ago...

Best regards,
Garvin

Posted: Fri Apr 28, 2006 7:34 pm
by Wetterfrau
We would like comment-searching functionality, too, and I don't see how to add it myself, despite the posts in this topic. My PHP skills are moderately good, but I'm not an expert in object-oriented programming, and I don't have much time to work on software, since my primary job is meteorology. I was also unable to find the reference to multilingual searching that Garvin mentioned.

We're using the PostgreSQL version of S9y v1.0 beta. Thanks in advance for any help you can provide.

Posted: Fri Apr 28, 2006 7:50 pm
by garvinhicking
Hi!

Searching the comments as well would take some time for implementing, since it cannot be merged with usuall fulltext entry search. So you would need to add it just like static page searches.

This feature request would be very nice to have; maybe you could please add it to our feature tracker on http://sf.net/projects/php-blog? Then a developer can take care of it as soon as someone has the time for it.

Best regards,
Garvin

Posted: Mon May 01, 2006 4:07 pm
by Wetterfrau
Thank you for your reply! One of my coworkers is a registered member of SourceForge, so I had him submit the feature request.

Posted: Mon May 01, 2006 5:37 pm
by garvinhicking
Hi!

I had some time today, so I solved your wish as a plugin. Read the SF Item for the file :)

Regards,
Garvin

Posted: Mon May 01, 2006 6:06 pm
by Wetterfrau
:shock:

That was fast! Danke!

When I attempted to add that functionality by guessing what the other posts meant, I managed to kill Quicksearch completely! At that point, I put things back the way they were (and Quicksearch worked again) and posted my original inquiry here.

We have installed the new plug-in and it appears to work well. 8)