Open main menu

lensowiki β

Changes

Help:Short words in searches

1,650 bytes added, 22:57, 7 February 2006
Changing minimum and maximum word lengths in MySQL
== Changing minimum and maximum word lengths in MySQL ==
From MySQL's docs on [http://dev.mysql.com/doc/mysql/en/fulltext-fine-tuning.html Fine-Tuning MySQL Full-Text Search]:
<div style="margin-left:1em">
The minimum and maximum length of words to be indexed is defined by the <code>ft_min_word_len</code> and <code>ft_max_word_len</code> system variables (available as of MySQL 4.0.0). See [http://dev.mysql.com/doc/mysql/en/server-system-variables.html Section 5.3.3, “Server System Variables”]. The default minimum value is four characters. The default maximum depends on your version of MySQL. If you change either value, you must rebuild your <code>FULLTEXT</code> indexes. For example, if you want three-character words to be searchable, you can set the <code>ft_min_word_len</code> variable by putting the following lines in an option file (you can simply put these lines in my.cnf):
<pre>
[mysqld]
ft_min_word_len=3

[myisamchk]
ft_min_word_len=3
</pre>

Then restart the server
<pre>
mysqladmin shutdown
mysqld_safe &
</pre>
and rebuild your <code>FULLTEXT</code> indexes. Also note particularly the remarks regarding '''myisamchk''' in the instructions following this list.
*to do this, simply run the mediawiki rebuild text script by [[Executing a Mediawiki Maintenance Script | executing a mediawiki maintenance script]] found in the wiki/maintenace directory
<pre>
php rebuildtextindex.php
</pre>
</div>
You might want to consult this site [http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html] for further reference.

== See also ==
* [[Help:Common words, searching for which is not possible]]
* [[Help:Searching]]
Anonymous user