Page 1 of 1

Unable to set mysql variable...

Posted: Fri Feb 03, 2006 6:20 am
by raghavan20
I am trying to bring down the minimum number of characters necessary for a full text search...

Code: Select all

mysql> 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.08 sec)

mysql> set ft_min_word_len=2
    -> ;
ERROR 1193 (HY000): Unknown system variable 'ft_min_word_len'
mysql> set variable=ft_min_word_len=2;
ERROR 1193 (HY000): Unknown system variable 'variable'

Posted: Fri Feb 03, 2006 8:27 am
by jmut

Posted: Fri Feb 03, 2006 8:50 am
by raghavan20
it is asking me to login..could you please paste the relevant information

Posted: Fri Feb 03, 2006 9:32 am
by josh
Try the following:

* Put the following in an option file:

[mysqld]
ft_min_word_len=3

* Restart server.

* Rebuild your FULLTEXT indices:

mysql> REPAIR TABLE tbl_name QUICK;

NOTE: if you use myisamchk to perform an operation, i.e. repair, that modifies table indices put the following in an option file:

[myisamchk]
ft_min_word_len=3

Posted: Fri Feb 03, 2006 9:33 am
by jmut
raghavan20 wrote:it is asking me to login..could you please paste the relevant information
Interesting I got in without login :))
Try the following:

* Put the following in an option file:

[mysqld]
ft_min_word_len=3

* Restart server.

* Rebuild your FULLTEXT indices:

mysql> REPAIR TABLE tbl_name QUICK;

NOTE: if you use myisamchk to perform an operation, i.e. repair, that modifies table indices put the following in an option file:

[myisamchk]
ft_min_word_len=3

Try onther browser or something it should not require any login :)
The topic is not very short.



....some posts later.
Thanks, it's working good now. Where should I store my custom stop words list? I tried placing it in the /ect/ directory on my server, but it doesn't seem to find it. Is there a good place to store this?

[mysqld]
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
ft_min_word_len=2
ft_stopword_file = /ect/noisewords.txt

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[myisamchk]
ft_min_word_len=2

Posted: Fri Feb 03, 2006 12:19 pm
by raghavan20
jshpro2 wrote:
Try the following:

* Put the following in an option file:

[mysqld]
ft_min_word_len=3

* Restart server.

* Rebuild your FULLTEXT indices:

mysql> REPAIR TABLE tbl_name QUICK;

NOTE: if you use myisamchk to perform an operation, i.e. repair, that modifies table indices put the following in an option file:

[myisamchk]
ft_min_word_len=3
What is meant by an option file...I already read this in Mysql manual but I cannot understand what they are saying..fyi...I am running Windows XP.

why does a normal set command work for this?

Posted: Sat Feb 04, 2006 2:08 am
by jmut

Posted: Sat Feb 04, 2006 6:07 am
by raghavan20
I did put the ft_min_word_len option in the my.ini file in the base dir of mysql 5 but still it reads these options somewhereelse...anybody have got any idea where it reads from other than the ini file in basedir. I do not see min and max word options in this file before I put my custom option in it...

Code: Select all

[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306

#full text minimum word length
ft_min_word_len=2



#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"

#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"

# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=latin1

# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB

# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=100

# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. See the
# "Qcache_lowmem_prunes" status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size=0

# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
table_cache=256