[Maria-discuss] Full text search not matching 2 letter word
Im trying to run a full text query on a two letter keyword 'K7'. I have set ft_min_word_len=2 and restarted the server and if I view the system vars in Mysql Workbench it shows it is set correctly. I have then dropped and re-created the index on the descrip column. It is an InnoDB table so I cannot do repair table. Im running the following query which I expect to match the following record but it doesnt. Full text searches for other words match OK. select * from asset where type ='DOCUMENTS' and (match(descrip) against ('K7' in boolean mode)) ; +-----+--------------------+----------------------------------------------------------------------------------------------+-----------+-------------------+--------------+-------------+ | id | type | descrip | subtype | intendeduse | location | assetfileid | +-----+--------------------+---------------------------------------------------------------------------------------------+------------+-------------------+--------------+-------------+ | 153 | DOCUMENTS | Telephone Kiosk No. 7 K7 Interior promo photo from field trial. | PHOTO | DISPLAY | STORAGE | 152 | +-----+--------------------+----------------------------------------------------------------------------------------------+------------+------------------+--------------+-------------+ Any ideas why this is not working? Thanks Andrew
For InnoDB, you need to change innodb_ft_min_token_size, as ft_min_word_len is for MyISAM only: https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_ft_min_tok... https://mariadb.com/kb/en/library/server-system-variables/#ft_min_word_len On 2019/01/09 13:39, Andrew Wood wrote:
Im trying to run a full text query on a two letter keyword 'K7'. I have set ft_min_word_len=2 and restarted the server and if I view the system vars in Mysql Workbench it shows it is set correctly.
I have then dropped and re-created the index on the descrip column. It is an InnoDB table so I cannot do repair table.
Im running the following query which I expect to match the following record but it doesnt. Full text searches for other words match OK.
select * from asset where type ='DOCUMENTS' and (match(descrip) against ('K7' in boolean mode)) ;
+-----+--------------------+----------------------------------------------------------------------------------------------+-----------+-------------------+--------------+-------------+
| id | type | descrip | subtype | intendeduse | location | assetfileid | +-----+--------------------+---------------------------------------------------------------------------------------------+------------+-------------------+--------------+-------------+
| 153 | DOCUMENTS | Telephone Kiosk No. 7 K7 Interior promo photo from field trial. | PHOTO | DISPLAY | STORAGE | 152 | +-----+--------------------+----------------------------------------------------------------------------------------------+------------+------------------+--------------+-------------+
Any ideas why this is not working?
Thanks
Andrew
Fantastic, thanks for pointing that out Ian On 09/01/2019 11:47, Ian Gilfillan wrote:
For InnoDB, you need to change innodb_ft_min_token_size, as ft_min_word_len is for MyISAM only:
https://mariadb.com/kb/en/library/innodb-system-variables/#innodb_ft_min_tok...
https://mariadb.com/kb/en/library/server-system-variables/#ft_min_word_len
On 2019/01/09 13:39, Andrew Wood wrote:
Im trying to run a full text query on a two letter keyword 'K7'. I have set ft_min_word_len=2 and restarted the server and if I view the system vars in Mysql Workbench it shows it is set correctly.
I have then dropped and re-created the index on the descrip column. It is an InnoDB table so I cannot do repair table.
Im running the following query which I expect to match the following record but it doesnt. Full text searches for other words match OK.
select * from asset where type ='DOCUMENTS' and (match(descrip) against ('K7' in boolean mode)) ;
+-----+--------------------+----------------------------------------------------------------------------------------------+-----------+-------------------+--------------+-------------+
| id | type | descrip | subtype | intendeduse | location | assetfileid | +-----+--------------------+---------------------------------------------------------------------------------------------+------------+-------------------+--------------+-------------+
| 153 | DOCUMENTS | Telephone Kiosk No. 7 K7 Interior promo photo from field trial. | PHOTO | DISPLAY | STORAGE | 152 | +-----+--------------------+----------------------------------------------------------------------------------------------+------------+------------------+--------------+-------------+
Any ideas why this is not working?
Thanks
Andrew
_______________________________________________ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Unsubscribe : https://launchpad.net/~maria-discuss More help : https://help.launchpad.net/ListHelp
participants (2)
-
Andrew Wood
-
Ian Gilfillan