Full Text search not working...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Full Text search not working...

Post by dardsemail »

Hi,

I am trying to conduct a full text search on a field in my DB.

The Query is structured as such:

Code: Select all

SELECT * FROM helpsources_tb WHERE MATCH (description) AGAINST ('test')
I have set up the 'description' field with a FULL TEXT index.

I have added a record with the value 'This is a test.' to the table.

When I search using the above query, I get 0 rows returned.

I'm perplexed as to why this isn't working. Any suggestions for troubleshooting?

Thanks!
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

as the manual says... if there are too many positive records (i believe a 50% treshold) no records will be returned at all...
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

Ah... very interesting. I hadn't seen that - thanks for the head's up.

I'll try and add a couple more records and see what happens.

Thanks again!
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

I added some more rows with the following descriptions:

This is a test.
yet another.
doing another.
one more time
let's see what

When I search on 'another' I don't get anything. In fact, the only search that gives me any results is the search on 'test'.

Very strange... I can't seem to get any other results on any other searches for any of the other words.

Any thoughts?
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

There are a lot of problems when testing full text search with a low number of words.

the 50% limit was already mentioned. There are also words with less than 4 letters excluded and certain word are considered trivial like 'and' 'or' probably 'another' as well.

Try adding real sentences of a certain length with some unusual words
Post Reply