Reinder de Vries
Reinder de Vries

Reputation: 522

Rewrite/change WordPress search mechanism

I've been looking for a way to change the WordPress searching mechanism. My database has several custom tables, which I want to take into account when searching the site. Also, I wan't to implement a levenshtein function for coming up with lines like "Did you mean [another term]?" when somebody makes a spelling error.

Is there a hook, action or function I can implement or change to allow these kind of functions? Any help is greatly appreciated.

Kind regards,

Reinder

Upvotes: 0

Views: 2129

Answers (1)

Wipqozn
Wipqozn

Reputation: 1314

You could just replace the WordPress search with your own search, by replacing your own search box with a custom search box which then calls a function which uses one of these searches. This will allow you to replace the default wordpress search without modifying the core files.

Three possible options would be:

I had to do a similar thing for my own WordPress site. I originally went with MySQL match against, but I have since switched to Sphinx. I ran into serious speed issues using MySQL match against, although those problems vanished when I switched to Sphinx.

Upvotes: 2

Related Questions