3-letter words not indexed in MediaWiki

From FVue
Jump to: navigation, search

Problem

If I search for a 3-letter word in MediaWiki, no matches are found.

Solution

Asked my ISP to put the following lines in an option file, typically /etc/my.cnf:

[mysqld]
ft_min_word_len=3

[myisamchk]
ft_min_word_len=3

Within MySQL do a:

SHOW TABLES;

and repair each table with the command:

REPAIR TABLE <tablename> QUICK;

Journal

20061008

(Mediawiki-l) possible to permit searches on 3 or fewer characters?

How to determine what MySQL-version my ISP (Internet Service Provider) is running?

I can access MySQL via an SSH tunnel.

mysql> \s
mysql  Ver 14.7 Distrib 4.1.13, for suse-linux (i686) using readline 5.0

Connection id:          x
Current database:       x
Current user:           x@localhost
SSL:                    Not in use
Current pager:          less
Using outfile:          ''
Using delimiter:        ;
Server version:         4.1.14
Protocol version:       10
Connection:             1.2.3.4 via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               x
Uptime:                 5 days 13 hours 20 min 8 sec

Threads: 1  Questions: 6864074  Slow queries: 9  Opens: 231395  Flush tables: 1  Open tables: 256  Queries per second avg: 14.300

MySQL 3.23, 4.0, 4.1 Reference Manual :: 12.7.5 Fine-Tuning MySQL Full-Text Search

mysql> SHOW TABLE STATUS;
mysql> SHOW VARIABLES LIKE 'ft%';
--------------
SHOW VARIABLES LIKE 'ft%'
--------------

+--------------------------+----------------+
| Variable_name            | Value          |
+--------------------------+----------------+
| ft_boolean_syntax        | + -><()~*:""&| |
| ft_max_word_len          | 84             |
| ft_min_word_len          | 4              |
| ft_query_expansion_limit | 20             |
| ft_stopword_file         | (built-in)     |
+--------------------------+----------------+
5 rows in set (0.01 sec)

Asked my ISP to put the following lines in an option file, typically /etc/my.cnf:

[mysqld]
ft_min_word_len=3

[myisamchk]
ft_min_word_len=3

20061011

My ISP was very kind to modify MySQL settings as stated above. While updating this text, I received errors:

Database error
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

    (SQL query hidden)

from within function "SearchMySQL4::update". MySQL returned error "1034: Incorrect key file for table 'searchindex'; try to repair it (localhost)

I did a mysql SHOW TABLES; on my mediawiki-1.6.7 and repaired all tables:

REPAIR TABLE archive       QUICK;
REPAIR TABLE blobs         QUICK;
REPAIR TABLE brokenlinks   QUICK;
REPAIR TABLE categorylinks QUICK;
REPAIR TABLE cur           QUICK;
REPAIR TABLE externallinks QUICK;
REPAIR TABLE hitcounter    QUICK;
REPAIR TABLE image         QUICK;
REPAIR TABLE imagelinks    QUICK;
REPAIR TABLE interwiki     QUICK;
REPAIR TABLE ipblocks      QUICK;
REPAIR TABLE job           QUICK;
REPAIR TABLE links         QUICK;
REPAIR TABLE linkscc       QUICK;
REPAIR TABLE logging       QUICK;
REPAIR TABLE math          QUICK;
REPAIR TABLE objectcache   QUICK;
REPAIR TABLE oldimage      QUICK;
REPAIR TABLE page          QUICK;
REPAIR TABLE pagelinks     QUICK;
REPAIR TABLE querycache    QUICK;
REPAIR TABLE recentchanges QUICK;
REPAIR TABLE revision      QUICK;
REPAIR TABLE searchindex   QUICK;
REPAIR TABLE site_stats    QUICK;
REPAIR TABLE templatelinks QUICK;
REPAIR TABLE text          QUICK;
REPAIR TABLE trackbacks    QUICK;
REPAIR TABLE transcache    QUICK;
REPAIR TABLE user          QUICK;
REPAIR TABLE user_groups   QUICK;
REPAIR TABLE user_newtalk  QUICK;
REPAIR TABLE user_rights   QUICK;
REPAIR TABLE validate      QUICK;
REPAIR TABLE watchlist     QUICK;

Tested with search for SSH and 3-letter words are indexed all right!

Comments

blog comments powered by Disqus