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

Implemented Addition of a MySQL FULLTEXT 'minWordLength' setting in the admin.

Discussion in 'Closed Suggestions' started by TimWF, Jan 24, 2011.

  1. TimWF

    TimWF Active Member

    As detailed in:


    The variable that sets the minimum word length for a search is set in the library/XenForo/Search/SourceHandler/MySqlFt.php (line 20) file. If you have a min other than 4 you can just edit this file accordingly to change the setting, but then of course when you upgrade your forum software that file can be overwritten, changing it back to the default 4.

    It would be great to have a way to set this in the admin area or something like that, just somewhere that isn't going to be overwritten upon upgrade. Thanks!
    twollert, Dean, krstep and 6 others like this.
  2. Vladislav Rastrusny

    Vladislav Rastrusny Active Member

    Don't forget, that this option in MySQL is set only in the my.cnf config file (cannot be set on-the-fly) and if you change it in MySQL, you need to rebuild all indexes to have this in effect.
  3. TimWF

    TimWF Active Member

    No doubt, perhaps it would be helpful to have that same information right next to this setting as well. I could see that someone that just ran into the setting could easily think that all they had to do was change it in the Xenforo back end otherwise.
    Vladislav Rastrusny likes this.
  4. Luke F

    Luke F Well-Known Member

    Perhaps better suited to a config.php setting?
    Dean likes this.
  5. Dean

    Dean Well-Known Member

    That would be my preference.. That would not get changed very often.. and keep the admincp cleaner.
  6. dvsDave

    dvsDave Well-Known Member

    I would prefer if I could create an exception list. A list of terms that are 3 characters or less that I wanted the search engine to index. Here's my current list from my still-production vB install.

    I run a technical theatre site and there are a LOT of 2 and 3 letter acronyms that the industry uses:

    Tigratrus and Darkimmortal like this.
  7. Tigratrus

    Tigratrus Well-Known Member

    That is an excellent idea. It would cut down on the overhead of the index SUBSTANTIALLY, and most nice community admins have (or can come up with) a list of 2 or three letter abbreviations that their community uses.

    Just search here (or... Heck on vb.com!) for any terms like RSS, CSS, SQL, CDN etc. etc.

    Clearly it's a common need. :)
  8. Dean

    Dean Well-Known Member

    Is there any progress on this?

    I need to keep changing this variable $_minWordLength = 3; after every upgrade. And of course when I run the new admincp -> Tools -> File Health Check it fails on that file.

    Just moving it to config.php would be fantastic. :)
    twollert likes this.
  9. Marcus

    Marcus Well-Known Member

    1. Either give us the option to enter a minimum lenght for mysql words or - better -
    2. fetch this value from my.cnf and use it

    Some posts from http://xenforo.com/community/threads/xf-search-engine.1143/
  10. Brogan

    Brogan XenForo Moderator Staff Member

    1.1.0 Beta 3 now has the option to set a minimum word length.

    Search Minimum Word Length
    This is the minimum length of a word that can be searched by the index. With the default search system, this should correspond with the MySQL full text minimum word length (normally 4).
    Dean and Marcus like this.
  11. Marcus

    Marcus Well-Known Member

    Great :)

Share This Page