If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Too many records with fulltext search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-07, 04:32
Oddish Oddish is offline
Registered User
 
Join Date: Mar 2003
Posts: 43
Question Too many records with fulltext search

I'm trying to create a simple search function and noticed that when there are too many matching rows, nothing is returned. Is there any way to remove this limitation, or at least some way to find out if too many rows were returned? How do I know if there were 0 matching rows, or too many matching rows? MATCH() returns 0 in both cases.
Reply With Quote
  #2 (permalink)  
Old 04-24-07, 05:07
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
What is the sql statement that you are executing??
Reply With Quote
  #3 (permalink)  
Old 04-24-07, 23:20
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
i'm not sure about full text indexing, but I know that a regular index ignores search terms that appear in 50% or more of the rows. there is no way to change that that I am aware of. full text indexing may be the same.
Reply With Quote
  #4 (permalink)  
Old 04-25-07, 03:36
Oddish Oddish is offline
Registered User
 
Join Date: Mar 2003
Posts: 43
Quote:
Originally Posted by aschk
What is the sql statement that you are executing??
The match part in the "where" clause is
Code:
AND
	MATCH (
		s.body,
		s.address,
		s.zip,
		s.city
	) AGAINST(
		'search phrase'
	)
";
But anyway, I'll just write something like "Your search returned no results, or matched more than 50 % of the records".
Reply With Quote
  #5 (permalink)  
Old 04-25-07, 07:23
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
In order to by-pass the 50% limitation you need to use a BOOLEAN match in your search. See : http://dev.mysql.com/doc/refman/5.0/...t-boolean.html

So ideally what you should be doing is this :
Code:
AND
	MATCH (
		s.body,
		s.address,
		s.zip,
		s.city
	) AGAINST(
		'search phrase'
	)
       IN BOOLEAN MODE
";
This will find any results which match your search pharse with at least one word from the search phrase.

Last edited by aschk; 04-25-07 at 07:29.
Reply With Quote
  #6 (permalink)  
Old 04-25-07, 10:45
Oddish Oddish is offline
Registered User
 
Join Date: Mar 2003
Posts: 43
Quote:
Originally Posted by aschk
In order to by-pass the 50% limitation you need to use a BOOLEAN match in your search.
Wow, that was easy! Thanks a lot!
Reply With Quote
  #7 (permalink)  
Old 05-04-07, 07:27
Oddish Oddish is offline
Registered User
 
Join Date: Mar 2003
Posts: 43
I've been thinking about this, and I don't really se any real world use for fulltext search. I'd bet that 99% of users expect to find "theword" if they search for "ewor", and this is apparently impossible with fulltext search. Now I'm forced to build a custom engine with LIKE statements...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On