Solved

how can i disable the stopword in mysql php

Posted on 2008-11-03
3
489 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
Comment Utility
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
Comment Utility
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
Comment Utility

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to count occurrences of each item in an array.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now