SECURITY WARNING: PLEASE RE-DOWNLOAD THIS HACK IF YOU ARE USING IT, A VERY SERIOUS VULNERABILITY HAS BEEN DISCOVERED AND FIXED.
David Merwin has modified my Contextual Search hack for WordPress to work with WordPress 1.5. This is now offered as [EDIT] a zip file [EDIT] and installation is quite simple. The feature set remains the same as before.
- Text based “fuzzy†searches within WordPress
- A nice Google like interface which is very customizeable
- Search results with decreasing relevance to search topic
- Trap for words which are less than four letters long, the search then gets routed through the default WP search
- “Next results†button which shows the next 10 (or less) results in relevance
Download Advanced Contextual Search for WordPress 1.5
Please leave bugs and comments here. I am sure David will check this often.
Has this been used with the ‘default’ theme in WP 1.5? It only seems to apply to ‘classic’.
I ran the install page and it said ‘succeeded’ – is there supposed to be a new plug-in present in the plug-ins folder? I don’t see anything listed on the ‘plug-ins’ panel in admin either…is that correct?
I don’t have the file listed in the readme (wp-layout) but I tried the modification with ‘style.css’… no joy
The text to replace isn’t even in use…
Suggestions?
Ken
The documentation (i.e. “readme.txt”) does not seem ready for WP1.5. Please can the author/s update the readme and announce when it has been incorporated into the zip download.
The default search is really crap, I’ve installed lots of other tools like PHPDig but they dont cut the mustard, Instead im going to google but it in a hacked up kind of way.
This is not an actual plug-in in that it does not use the API hooks for attaching scripts to WordPress. You simply run teh script to create a FULTEXT index and then point your search form to search.php. You will need to edit some minor code in the index page. That is it though. I modified the files in such a way as to be able to follow the same instructions. I will look them over and see what needs tweaking.
Thanks.
Ken – what do you mean “The text to replace isn’t even in use…”. Could you clarify?
Hi.
I’ve been unsuccesfull in implementing the advanced search for my wordpress 1.5. A quick glance at the search.php file tells me, that it’s not prepared for WP1.5. The CSS link is still pointing towards wp-layout.css, which is no longer in use in WP1.5
I’m a big fan of the new “Pages” function, but as many others I would like the search function to include the “Page” too.
I’ve found that it’s the searchform.php file that needs editing and not the index.php. I can’t seem to figure out how I place the search results in the default design yet.
If you do. I would love to know.
David:
Sorry – I meant that the php in the readme that is supposed to be swapped out is found in the WP 1.5 ‘Classic’ theme, but not found in the ‘default’ theme – it seems this mod is written specificallly and only for the ‘Classic’ theme…or did I simply not see it?
I followed the instructions to install, and it seemed to update the db, so I moved to making the changes as noted, but I couldn’t find the php that was supposed to be changed…then it dawned on me to look at the other theme as shipped with WP1.5.
I’m concerned now that I’ve modified the db and don’t know how to undo, but it doesn’t seem to have affected anything – meaning I’m not (yet) using the code changes.
Is there any concern for slowdowns in the way this is implemented?
Thanks for the reply.
Ken
David:
The text block the readme says to replace in ‘index.php’ is located in ‘sidebar.php’ in the classic theme directory in my version of WP1.5.
If I replace that text and use the classic theme, it can’t find ‘search.php’, as it
is in the root of the active directory.
I’m confused why the instructions say to modify ‘index.php’ at the root level (is that correct?) since it only holds this content:
Am I using a different build of WP1.5?
David:
The text block the readme says to replace in ‘index.php’ is located in ‘sidebar.php’ in the classic theme directory in my version of WP1.5.
If I replace that text and use the classic theme, it can’t find ‘search.php’, as it
is in the root of the active directory.
I’m confused why the instructions say to modify ‘index.php’ at the root level (is that correct?) since it only holds this content:
Am I using a different build of WP1.5?
sorry – trying to get the 5 lines of code to show for the index page:
php
/* Short and sweet */
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
?
I think it may be time to make this as a true plug-in. I will start workign on it and post here when it is ready.
Thanks for all of the input.
Hi Dave, how’s the plug-in coming along? Need anyone to help with testing?
Greg.
Are you adding an index on the article and categories tables with fulltext(name,content etc) ? does this not create massive amounts of overhead? I would think that searching row by row would be slower, but less overhead then updating/duplicating information to an index every time a post is made.I usually work with Berkley so I could be wrong, my mysql knowledge is limited.
It DOES add overhead, but not enough to warrant not using the feature. If you have hundreds of thousands of articles and millions of comments, I would remove the index and not use this search, otherwise the impact is limited.
As for searching row by row, the fuzzy intelligence will have to be built into the query rather than the easy method it uses now.
Read more about it here and details on fulltext here
thanks for the reply, and the links. i’m gonna check this out for sure becuase the becuase the default search is horrible. I’ve looked at a few of your contribs for wordpress, nice stuff.
Hi, I am looking for code that can search the category title besides the post title/body. Does anybody know how I can achieve this? Any help is much appreciated!
Hello Dave…
This Advanced Search WordPress 1.5 still can’t running. u can view my blog. After i’m using, i can found to search any key have on my iste. But serach.php cannot display my theme!
I need to uninstall Advanced Search WordPress 1.5 all file i can delete, but how can i’ll delete new Mysql table after install b4?
How do you remove this hack from the site?
Will the altered tables need to be unaltered?
NO, the tables do not HAVE to be altered. To remove the hack, just remove the search.php from your website and any links to it.
Just wondering how you’ve come along with developing a plugin for this? I tried to get it to work, it amended the database but when trying to use search it had an issue with fields in the database not matching… has WP changed something that makes it now unworkable in its current state?
cheers
Thanks for a nice plugin (hack).
As somebody mentioned, it is not for WP 1.5, if the themes is different (i have a travelogue), but anyway I managed to run it, look at http://www.kris-egis.com/chegis/search.php.
#3, I opened sidebar.php the required portion of the code.
#4 I needed to creat a file wp-layout.css in the root dir.
But I still do not understand how the “Text based “fuzzy†searches within WordPress”
I tried to search “Kveinys” and there was some matches. but for “Kveinas” nothing (one letter changed). Thought that this ‘fuzzy” hack that as well.
It would be fine to have possibility to use * symbols 🙂
gg
Where to get the new version now,… seem to me the site of David is down?
Site of David Merwin not working? Possible to download the plugin anywhere else?
Olaf