Jump to content


Photo

full text search accuracy


  • Please log in to reply
4 replies to this topic

#1 chico1st

chico1st
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 23 August 2006 - 12:50 AM

okay i have a full text search, it works, and here is the query
$query = "SELECT news.newsID, news.name AS news, news.abstract, news.fulltext, date.name AS date, author.name AS author,
              MATCH(news.name, news.abstract, news.fulltext)
              AGAINST ('$searchstring') AS score FROM news, date, author
              WHERE MATCH(news.name, news.abstract, news.fulltext)
              AGAINST ('$searchstring')
  AND date.dateID = news.dateID AND author.authorID = news.authorID
  ORDER BY score DESC";

but even if i know a certain word is in the entry im searching, often i wont get any articles coming up as results.

Is there anything that might cause this like the 50% threshhold? or blocked words?

for instance if I search 'database' i get a result, yet right next to it is the word 'available' but if i type that in there are no results

Any idea why?

ALSO!  if i want to make a certain field more sensitive would I have to make it its own table.. like a title table? or can i just choose to search that field? i know i have to have the same fields in my select as are in my index table so i cant just not include a field as far as i know



THANKS!

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 23 August 2006 - 01:58 AM

The refman has all sorts of details about the nuances of FULLTEXT searching -- if your keyword matches too many things, it won't "match".  And yes, there are stopwords, and other things like that.  The best way is to make your own index.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 chico1st

chico1st
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 23 August 2006 - 03:55 AM

well i did make my own index but i want to be able to search the title OR the abstract OR the fulltext

okay.. well that just means that the inaccuracy is out of my control :P which is good news... take that users!

#4 chico1st

chico1st
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 23 August 2006 - 04:13 AM

ive noticed that i can make more than one index. the one that the search seems to default to is 'full_index' can i make more than one index then just point my search at different index's?

also i eliminated  the text area and just left the title, abstract,... 4 fields in total... it officially doesnt work.. but there is no error

here is the query:
$sql = "SELECT research.researchID, research.name AS research, research.coresearch, research.affiliation, research.abstract,
research.fulltext, date.name AS date, author.name AS author,
              MATCH(research.name, research.abstract, research.coresearch, research.affiliation)
              AGAINST ('$searchstring') AS score FROM research, date, author
              WHERE MATCH(research.name, research.abstract, research.coresearch, research.affiliation)
              AGAINST ('$searchstring')
  AND date.dateID = research.dateID AND author.authorID = research.authorID
  ORDER BY score DESC";
this is what its searching:
 
research name: More crazy research
abstract: The plague is bad
co-researcher: botton
affiliation: school

it has 9 words to search and if i type in any of them it wont find the article.. are all the words occuring too often?


#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 23 August 2006 - 01:13 PM

It also depends on how many records there are to search... FULLTEXT works best on thousands of records.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users