Oct 30 2005
Finally got LiveSearch working
[tag]Wordpress[/tag][tag]plugin[/tag]I finally worked out that
I still need to tweak the CSS to fit my theme but at least it isn’t throwing ugly PHP errors now and functionally works but the search algorithm is pretty weak:
where post_content LIKE '%$item%'"
Might have to do something about that…
EDIT: ARGH! It is still borked for certain terms like “girl”, WTF? I think it is something wonky with get_permalink, maybe the posts with girl in them have some weird characters in them or something.
EDIT2: Seems like there is a bug in template-functions-links.php on line 92:
$pagestruct = $wp_rewrite->get_page_permastruct();
Commenting that out seems to fix the problem but now to find out why *scratches head*
You know, you always find the coolest Wordpress plugins.
That one has been around for a while actually I just couldn’t get it to work on SVN. I still can’t work out what is wrong with that line from template-functions-links.php so I’ve temporarily replaced it with just setting the permalink structure for pages manually.
The problem was always with that line, it is just that search terms 3 characters or less were more likely to return one of the static pages and that was breaking the code, for some reason I just hate dealing with classes in PHP, don’t ask me why but they just feel wrong so it is taking me a while to figure it out.
I also think you were getting the error because mysql’s ft_min_word_len is set to 4, meaning that a word has to be at least 4 characters. It’s on this page: http://dev.mysql.com/doc/refman/4.1/en/myisamchk-general-options.html
Hope that helps explain why the error was happening.
That is what I was thinking at first but my posts table is tiny in the scheme of things so not using the index isn’t a big deal and the query still returns quite quickly.
It is something to do with the quoted line in core Wordpress, I just don’t know what exactly.