Jump to content

Full Text Searching & the 50% Threshold


mentalist

Recommended Posts

Hi,

 

I can work many aspects of full-text searching, however what 'they' call the 50% threshold still kicks me every time.

 

Say I construct data in a table which is all very relevant / similar, then the returned results are either none, or the relevance's are all the same.

 

Say here's a table definition:

CREATE TABLE test_search (id int not null primary key auto_increment, title varchar(128), info text, FULLTEXT(title,info) )

 

And into I put the following data:

INSERT INTO test_search VALUES
	('','One','jelly fish'),
	('','Two','jelly fish jelly fish'),
	('','Three','jelly fish jelly fish jelly fish'),
	('','Four','jelly fish jelly fish jelly fish'),
	('','Five','jelly fish jelly fish jelly fish jelly fish jelly fish'),
	('','Six','jelly'),
	('','Seven','jelly welly'),
	('','Eight','jelly boot')

 

Then a query of:

SELECT title, info, MATCH(title, info) AGAINST('fish') AS relevance FROM test_search WHERE MATCH(title, info) AGAINST('fish')

yields absolutely no results...

 

On the other hand if I initially set the table data to:

INSERT INTO test_search VALUES
	('','One','jelly fish'),
	('','Two','jelly fish jelly fish'),
	('','Six','jelly'),
	('','Seven','jelly welly'),
	('','Eight','jelly boot')

then I get two results, each with the same relevance, even though one result should be twice as good as the other...

 

WHY? HOW? PLEASE!

Link to comment
https://forums.phpfreaks.com/topic/190372-full-text-searching-the-50-threshold/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.