• So I’m seeing some very odd behavior when trying to do searches against WP_TERMS.

    Using a simple query:

    SELECT * FROM wp_terms WHERE MATCH (name) AGAINST ($keywords IN BOOLEAN MODE)

    returns varied results. When I use ‘landscape’ as the search term, I get results. When I use something like ‘tv’, I get nothing.

    Any ideas? I haven’t added any new indexes to the table, or so I’m guessing (maybe a plugin added some…) – just the three:

    PRIMARY | PRIMARY
    slug | UNIQUE
    name | INDEX

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter rheric

    (@rheric)

    Ok, found one part of the odd behaviour – the term ‘tv’ is too short for the MATCH. Must be four characters in length or longer.

    However, other terms, such as ‘serious’ return nothing as well…

    Mysql default stopword list.

    Also why are you using ‘IN BOOLEAN MODE’? You aren’t really using any of boolean mode’s logic and you get results ordered by relevance if you don’t use it.

    Thread Starter rheric

    (@rheric)

    Excellent. Thanks!

    As for Boolean Mode, I went with it because with all the trial and error, it seemed to return more consistently. No other reason, really.

    Is there a way to turn off stopwords?

    Thanks again!

    Yes. You can turn off stopwords… if you have access to the server configuration files. It is really very annoying.

    Thread Starter rheric

    (@rheric)

    Heh…well, I’m not much for digging that deep, particularly on a hosted site.

    Thanks for the help!

    I’m not sure you can dig that deep on a hosted site. That is low level configuration stuff and it effects everyone using the MySql server which on a shared host is a fair number of other people. If you’ve got a dedicated server you might have more flex but 15 dollars for shared hosting vs. 50+ for dedicated… not many people go dedicated.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘MATCH search against wp_terms???’ is closed to new replies.