1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adjusting MySQL fulltext search

Discussion in 'Troubleshooting and Problems' started by ChemicalKicks, Jan 6, 2012.

  1. ChemicalKicks

    ChemicalKicks Well-Known Member

    Running Ubuntu 10.04 LTS

    I'm attempting to get a change show when searching for words on my forum, currently I am stuck on a limit of 4, would like it to be 3.

    • I changed the minimum work length limit in ACP > Search Options > 3
    • I went ahead and edited my.cnf by adding
    • I restarted the mysql server then rebuilt search. Rebuild Caches > Rebuild Search Index > All

    So in theory I should be able to search for say 'map', right? Searching for 3 letter words brings up nothing, I fear I'm missing a very obvious step :p

    Thanks in advance.
  2. steel_curtain

    steel_curtain Well-Known Member

  3. ChemicalKicks

    ChemicalKicks Well-Known Member

    Thanks for the heads up, I had read through both of those a couple of times though :)

    I had made the file edit suggested even though I think it's now redundant, can someone confirm?

    IDK what I'm missing at this stage, as a last resort I've done a full reboot and am rebuilding the search index again.
  4. ChemicalKicks

    ChemicalKicks Well-Known Member

    Right something fishy here.

    You can see that I have indeed modified my.cnf correctly.
    ft search.png
  5. steel_curtain

    steel_curtain Well-Known Member

    ChemicalKicks likes this.
  6. ChemicalKicks

    ChemicalKicks Well-Known Member

    Cheers :)

    I honestly don't know if this is the issue but yesterday when trying to sort this I did add in the additional option to my.cnf and it didn't change the result.

    As far as I can tell even though the minimum word length is now 3 it's like the search indexes haven't rebuilt with the 3 letter count.
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try repairing your database using a program like phpmyadmin. Most of the tables are InnoDB which don't support repair, but the xf_search_index table is MyISAM which does. And I seem to remember that a repair is necessary to rebuild the index following the change you have made.

    And make sure your search string doesn't contain a stop word:


    They are also listed in:

  8. ChemicalKicks

    ChemicalKicks Well-Known Member

    Hey Jake,

    Thank you. I don't have phpmyadmin installed and I don't think I want to :D Would it be enough to repair the table (xf_search_index) from CLI then rebuild the search index again?
  9. ChemicalKicks

    ChemicalKicks Well-Known Member

    Right that worked.

    For anyone else wanting to follow in my footsteps.

    To repair "xf_search_index"

    I issued the following commands in CLI

    mysql > USE dbname;
    mysql> REPAIR TABLE xf_search_index QUICK;
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I'm late, but yes that command is equivalent to running a repair in phpmyadmin.
    ChemicalKicks likes this.

Share This Page