Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how can i disable the stopword in mysql php

Posted on 2008-11-03
3
Medium Priority
?
550 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:
Umesh earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

773 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