Extending quicksearch

Discussion corner for Developers of Serendipity.
Post Reply
alexmloveless
Posts: 1
Joined: Sun Apr 02, 2006 9:11 pm

Extending quicksearch

Post 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
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post 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.
Judebert
---
Website | Wishlist | PayPal
DarKRaveR
Regular
Posts: 20
Joined: Wed Mar 29, 2006 7:35 am
Location: FFM, Germany

Post 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 ...
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Wetterfrau
Posts: 3
Joined: Fri Apr 28, 2006 7:12 pm
Location: Oklahoma, USA

Post 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.
Ich spreche kein Deutsch.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Wetterfrau
Posts: 3
Joined: Fri Apr 28, 2006 7:12 pm
Location: Oklahoma, USA

Post 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.
Ich spreche kein Deutsch.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Wetterfrau
Posts: 3
Joined: Fri Apr 28, 2006 7:12 pm
Location: Oklahoma, USA

Post 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)
Ich spreche kein Deutsch.
Post Reply