[wp-hackers] Search system improvements

Kodie kodieg at gmail.com
Wed Jul 30 06:32:43 GMT 2008


Hello everyone!

I would like to share with you with a piece of code. Maybe someone would 
like to test it or look at the code. I will appreciate any word of advice.

So basically, what would I like to show? It's a patch for WordPress 
(tested with trunk svn version from two days ago or so) that add support 
for new search framework. This framework allows to manage different 
search engines. It is integrated in query.php file. So when, searching 
is performed, search framework picks appropriate search engine and do 
searching.

Search plugins can be packaged as WordPress plugins. I've created new 
search engine for wordpress. It allows searching within pages, posts, 
attachments and comments. I hope it will work nice.

I am creating also engine based on Google Search API. It's not really 
tested so it may not work properly.

Here are links where you can download all files:
[1] Patch for search framework
http://inzynieriawiedzy.org/kodie/search-egnine-trunk.patch
[2] New search engine
http://inzynieriawiedzy.org/kodie/default-search-engine.tgz
[3] Google search engine
http://inzynieriawiedzy.org/kodie/google-search-engine.tgz
[4] Sample search results template
http://inzynieriawiedzy.org/kodie/search-template.php.txt

I've attached template because it is quite not compatible with standard 
templates for now. However, I will try to fix it somehow.

So how to change search engine? Simply by adding field called 
'search_engine'. Possible values are 'default' and 'google'.

You can also change template which will be used to display search 
results. To do it just use field called 'wp_template' and enter there 
template file name.

I am currently working on Zend_Lucene search engine. However, it is in 
very alpha version.

Thanks,
Kodie

P.S. Eric Marder, have you received my replies for your mails?


More information about the wp-hackers mailing list