Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FullText Search

Status
Not open for further replies.

WilliamMute007

Programmer
Sep 30, 2007
116
GB
Hi all,

I am incredibly lost here. I am trying to implement a fulltext search on my mysql table. I think I have succefully done it but every time I query the table it returns unexpected result. i.e My table has the following data (Shiny Shoes Ltd). When I search for shoes, it returns no result but when I search for Shiny it gives result. so its very tricky. I just wanted it to return result if Shiney or Shoes or Ltd is typed in. Please can anybody help?

I have also included all my code to help diagnose the problem below.


Code:
Create table businesses(
  id integer not null primary key auto_increment,
  Company varchar(100),
  ContactName varchar(100),
  ServicesSummary varchar(50),
  ServicesDetailed varchar(150),
  fulltext(Company, ServicesDetailed)
) engine = MyISAM;


My Query is as followed

Code:
$sql = "Select * from `businesses3` where match(Company,ServicesDetailed) against ('".$keyword." with query expansion')";

Thank you so much for you help.
 
how many business tables do you have? (you've shown two)

how many rows in the table you're searching?

why are you using "with query expansion"?

and did you realize your "with query expansion" is actually contained inside the string to be searched for?


r937.com | rudy.ca
 
Thanks for that reply r937. I actually have 1 businesses table named businesses3. My create table code above is slightly outdated but the table is actually named businesses3. I am searching selecting every row in the table but only searching two columns (Company,ServicesDetailed) for a match with the query keyword.

I saw an example on the web that had the "with query expansion" and I did not know its also included in my search keyword is it? What could be my best way forward then please?
 
Thanks once more r937.. am not at home now until later tonight so I will try it and let you know. Hopefully this my just do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top