Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

min word len

Posted on 2009-04-29
10
Medium Priority
?
956 Views
Last Modified: 2012-05-06
hello there,
I would like to search for two letter words using mysql and someone said to use ft_min_word_len
I read this but still not sure http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html
how exactly do I do that?
0
Comment
Question by:XK8ER
  • 6
  • 4
10 Comments
 
LVL 21

Accepted Solution

by:
K V earned 2000 total points
ID: 24258521
1. Your table engine must be MyISAM.
2. Apply fulltext index on field which you want to search.
3. Go to mysql console and type:
     SET GLOBAL ft_min_word_len=2;
4. Execute following query:
    SELECT * FROM TABLENAME  WHERE MATCH(FIELDNAME) AGAINST ('xy');
5. If it worked: go to my.cnf and under [mysqld] section add following:
ft_min_word_len=2
0
 
LVL 1

Author Comment

by:XK8ER
ID: 24260576
I added this ft_min_word_len=2
into my my.cnf file and then restarted the mysqld service then from phpmyadmin in variables i see this ft min word len 4
0
 
LVL 21

Expert Comment

by:K V
ID: 24260591
I hope you don't already have that variable set to 4 in my.cnf. If so than just update the value to 2.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 1

Author Comment

by:XK8ER
ID: 24260657
this is what i get when i try to connect to mysql

-(10:06 38 AM)-(root@dedicated)-(~) $ mysql -u root -p --password=temp123
mysql: unknown variable 'ft_min_word_len=2'
-(10:08 09 AM)-(root@dedicated)-(~) $
0
 
LVL 1

Author Comment

by:XK8ER
ID: 24260664
this is what I get when I try to set the global

mysql> SET GLOBAL ft_min_word_len=2;
ERROR 1193 (HY000): Unknown system variable 'ft_min_word_len'
mysql>
0
 
LVL 1

Author Comment

by:XK8ER
ID: 24260683
mysql> SHOW VARIABLES LIKE 'ft_min%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| ft_min_word_len | 4     |
+-----------------+-------+
1 row in set (0.00 sec)
0
 
LVL 21

Expert Comment

by:K V
ID: 24260690
0
 
LVL 1

Author Comment

by:XK8ER
ID: 24260706
theGhost_k8, thats exactly what I did!
0
 
LVL 21

Expert Comment

by:K V
ID: 24260804
yep ! by bad at step 2.. we can't directly change fulltext parameters.
http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html
0
 
LVL 1

Author Comment

by:XK8ER
ID: 24260828
same link i posted
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question