I've actually just started playing with full text indexes and have been following this thread along with searching the internet. I'm not using MySQL 4 yet, so my options are limited. I do have a need to search on three letter words (i.e. C++,ASP,AIX,awk, XML).
What I am doing now, which seems to be working well, is to add a HAVING clause at the end of my query that essentially replicates the full text MATCH/AGAINST clause with only the "short" words. Thus whatever is "dropped" from the MATCH/AGAINST because of stop words or other criteria is caught by the HAVING clause. And since the HAVING criteria is executed only after the other search criterias, it should only search on a small set of data so there won't be a big performance hit. There are some issue with this angle, like searching on only 3 letter words won't work.

An example:
SELECT Resume FROM Resume
WHERE MATCH(Resume) AGAINST('+solaris +c++ "shell script" +awk')
HAVING Resume LIKE "%c++%" AND Resume LIKE "%awk%"

Like I said, this is my first attempt at this which seems to be working. Although "c++" worries me because of the pluses, but it seems to be working. I doubt this will scale though. I'm testing on 2,000 resumes right now and searches are averaging 1-2 seconds. But, this is on a 350Mhz G4 Mac running 10.1.5 with 224MB RAM and no MySQL tuning. So there is plenty of room for easy improvement.

On Thursday, November 21, 2002, at 06:44 AM, Thomas Spahni wrote:

Kevin,

are you sure that your 2 and 3 letter words do not appear in more than
half of all rows? That would exclude them from the search.

Thomas

On Wed, 20 Nov 2002, Kevin Lewandowski wrote:

Hi, Sergei.

In myisam/ftdefs.h I changed:

#define MIN_WORK_LEN 4

to:

#define MIN_WORD_LEN 2

and I commented out the line:

#define COMPILE_STOPWORDS_IN
(this should leave out stopwords right?)

There were no changes to ftstatic.c

recompile, reinstall, restart mysql.

To test I dropped and recreated the fulltext index on the existing
table. Fulltext search didn't find any 2 or 3 character words.

I also created a new table (from the articles example in the mysql
manual) and that didn't see any 2 or 3 character words either.

thanks

On Wednesday, November 20, 2002, at 09:18 AM, Sergei Golubchik wrote:

Hi!

On Nov 18, Kevin Lewandowski wrote:
I'm using mysql fulltext indexes and want them to see words of 2 or
more characters, and no stopwords. I've edited the appropriate files
(ftdefs.h, ft_static.c), then recompile, install, restart mysql,
rebuild indexes, and there is no change. It still uses a minimum of 4
characters). I'm using mysql 3.23.52-max. Am I missing something? Can
anyone help?
What changes, exactly did you make in ftdefs.h and ft_static.c ?
How did you test, whether 2-char words are indexed or not ?

Regards,
Sergei

--
MySQL Development Team
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



________________
Kevin Lewandowski
Discogs - http://www.discogs.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-
[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-
[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to