[wp-hackers] Page searching examples [was: 2.4 planning discussion]

Otto otto at ottodestruct.com
Wed Oct 3 20:29:29 GMT 2007

Well, maybe I'm thinking this through too hard or something, but I was
considering how the search functionality works. It's through the
normal WP_Query and Loop mechanism, so if it's returning Page content,
then a normal search loop is going to display Page content on the
search results. While not all search results pages display
the_content, quite a few do, and so the results could be rather
interesting, to say the least. Even your contact form placeholder is
going to cause it to spit out the placeholder, and if your plugin is
hooked to the_content, well, you get a form on the search results
page. Probably not expected behavior.

Now, I also agree with Andy on this one, that we need a relevance
ordered search system. I'd suggest that perhaps it might be worth
pulling search away from the normal query mechanism entirely, and
creating special search functionality. Right now it's using a rather
annoying LIKE mechanism to look for matches, which is strange to me
since mySQL has a rather nice MATCH() functionality to do natural
language searching built right in that we could use instead. It could
give back relevance values for better ordering of results, and we
could then even play with it to eliminate "special" Pages, if there
was some way to detect them as being such.

Maybe I'll work up a demo, see what I can figure out there.

More information about the wp-hackers mailing list