set new value for "ft_min_word_len " FULLTEXT in mysql
Asked Answered
C

5

15

I changed to "ft_min_word_len" = 4 by my-innodb-heavy-4G.ini located in my system path "C:\Program Files\MySQL\MySQL Server 5.1" , but when i run

SHOW VARIABLES LIKE 'ft_min_word_len'

I got still result value= 4. I did not find this variable in my.ini file. So i have also create a my logic. I copied to ft_min_word_len variable and place in my.ini file and now my result show value=3.

But it is not working for three character search. I've restarted server.

How can i achieve to be able to search three character value also.

Connelley answered 1/2, 2013 at 12:51 Comment(0)
E
24

You should change this system parameter, restart server and then rebuild ALL FULLTEXT indexes.

REPAIR TABLE <TableName> QUICK;
Esra answered 1/2, 2013 at 13:1 Comment(4)
thank you for your reply, i just did all activity but not working :(. i am using Windows. my directory C:\Program Files\MySQL\MySQL Server 5.1 . i did not get in my.ini. i got it in my-innodb-heavy-4G.ini file. please sir check it . thankxConnelley
thank u . i have also changed in wamp server mysql . i forgot about it :)Connelley
MySql InnDB says repair is not supported.Wainscoting
Here's described how to rebuild indexes for inno db tables:dev.mysql.com/doc/refman/5.7/en/…Uncap
B
7

This is what I use for getting all needed repair commands:

SELECT DISTINCT CONCAT("REPAIR TABLE `", TABLE_SCHEMA, "`.`", 
TABLE_NAME, "` QUICK;") FROM information_schema.STATISTICS 
WHERE index_type = 'FULLTEXT';
Believe answered 21/1, 2014 at 20:21 Comment(0)
B
3

I think you should try altering table by drop index and again add index. It will surely work.

Babbage answered 15/9, 2013 at 6:15 Comment(0)
A
0

You could just drop and add the FULLTEXT index

or do it in stages and see how big it will get in advance

CREATE TABLE models_new LIKE models;

ALTER TABLE models_new DROP INDEX name;

ALTER TABLE models_new ADD FULLTEXT name (name);

ALTER TABLE models_new DISABLE KEYS;

INSERT INTO models_new SELECT * FROM models;

ALTER TABLE models_new ENABLE KEYS;

ALTER TABLE models RENAME models_old;

ALTER TABLE models_new RENAME models;
Anaptyxis answered 28/4, 2015 at 6:33 Comment(0)
F
0

I just had and solved a similar problem of my own. The problem in my case is that the my.ini file I needed to edit in order to change the ft_min_word_len variable was in a directory that's hidden/protected by default in Windows 7. That's: "c:/programdata/mysql/mysql server 5.7".

Windows file explorer and searches don't show this location until you go into folder options and specify that you want to see hidden files/folders (and possibly protected operating system files--I did both).

Initially I created a my.cnf file under Program Files/MySQL Server 5.7. But when I restarted the server the ft_min_word_len variable hadn't changed. Then I typed in some random text that I knew should trigger an error, but the server started up like normal. It seems that MySQL wasn't reading the file, even though it was in one of the locations specified in the help text from the MySQL client shell.

My thinking is that the MySQL server starts searching for .cnf/.ini files in the order specified in the help text, but once it finds a valid file, stops searching. Just a theory, but I can say for sure that it wasn't recognizing configuration files in the other places it was supposed to be looking.

I figured it was like CSS, where each new CSS file overrides settings in the previous. Evidently not.

Anyway, I hope this will be of help to anyone else who runs into the same problem.

Filipino answered 31/12, 2015 at 0:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.