Solved

how can i disable the stopword in mysql php

Posted on 2008-11-03
3
496 Views
Last Modified: 2012-05-05
how can i disable the stopword in mysql
i am using the select match command using php and i want mysql to index all the word includeing the common words like old,new,and,or......
so how can i do this thanks
0
Comment
Question by:mgtm3
  • 2
3 Comments
 
LVL 7

Expert Comment

by:Valleriani
ID: 22866702
You need access to MySQL files.

I believe in my.cnf (mysqls config file) there is a variable called ft_stopword_file.

You can disable stopwords by setting the variable ft_stopword_file to an empty string and restarting.
0
 
LVL 7

Expert Comment

by:Valleriani
ID: 22866810
P.s.

if it is not there, you can login and check in mysql command based promt. Basicly get into a mysql prompt:

mysql -uroot -pPasshere

After you are logged in to mysql, you can type:

SET Global ft_stopword_file=
\g


\g is for GO, basicly. If it finds it, it should null it. Hopefully that will work if the first step doesnt
0
 
LVL 26

Accepted Solution

by:
ushastry earned 500 total points
ID: 22867050

This variable cannot be set dynamically.. i.e using SET GLOBAL ft_stopword_file =<somevalue>
=====================================================================
Name                  Cmd-Line       Option file       System Var       Var Scope       Dynamic
=====================================================================
ft_stopword_file       Yes          Yes                Yes                 Global                No
=====================================================================

This can be set thru commandline(while starting mysqld), thru optional file(my.cnf/my.ini)


The file from which to read the list of stopwords for full-text searches. All the words from the file are used; comments are not honored. By default, a built-in list of stopwords is used (as defined in the myisam/ft_static.c file). Setting this variable to the empty string ('') disables stopword filtering.

As given in above comment...pls place this in my.cnf/my.ini(if windows)

ft_stopword_file=''


Also, do remember

Note

FULLTEXT indexes must be rebuilt after changing this variable or the contents of the stopword file. Use REPAIR TABLE tbl_name QUICK.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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