473,378 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

PHP / MySQL relevance in searching

gregerly
192 Expert 100+
Hello,

I appologize as I've posted this in the PHP forum as well, but I think it is relevant here as well.

I've got a problem with a website search function. PHP for the front end, MySQL for the backend. The search function searches a field of keywords. The problem I'm having is that when someone searches for "Italian Food" it's bring back results for other resteraunts that are not italian, but do have the word Food in their keywords. Is there a way of adding relevance to a search, in a way that would make sense for the above senario?

Thanks in advance,

Greg
Jul 12 '07 #1
2 1645
mwasif
802 Expert 512MB
Use MySQL's FULLTEXT search. You can also use FULLTEXT in BOOLEAN MODE.
Jul 13 '07 #2
Atli
5,058 Expert 4TB
If you can't / won't use a fulltext search, you could always split the search string into words, and search for results for each word, and then rank each result based on how many of the words match it.

For example, if you search for 'Italian food' and restaurant A has the keyword 'FOOD', and restaurant B has both the word 'ITALIAN' and 'FOOD' then you could rank A = 50% and B = 100%, and return the results based on the ranking.
Jul 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: lawrence | last post by:
I've spent some time going over this page: http://dev.mysql.com/doc/mysql/en/Data_Manipulation.html And so far it seems the answer is no. So I thought I'd ask here. Does anyone know of any...
1
by: Hal Halloway | last post by:
How do I change a MYSQL Fulltext relevance value to: 0 to 100%. I'm just thinking about usability for the "average" user - maybe they would like to know...and would not understand the raw value. ...
14
by: Domestos | last post by:
Hi, TIA... 1) Need to select all rows from table called fixtures where home_team and away_team is equal to team_code. What SQL select statement would do this? 2) I have a variable called...
4
by: Michi | last post by:
I was wondering what the best solution is for making large numbers of TEXT (or BLOB?) fields searchable. For example, if I have a forum, what is the best way to be able to search for specific...
17
by: chicha | last post by:
Hey people, I have to convert MS Access 2000 database into mysql database, the whole thing being part of this project I'm doing for one of my faculty classes. My professor somehow presumed I...
2
by: Paul Bramscher | last post by:
What are the mechanisms to make words like a/an/the in text and varchar character fields ignored when performing SELECT and utilizing ORDER BY in SQL queries? I've done some hunting around into...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
2
by: Richard Brosnahan | last post by:
I hate asking questions that have probably been answered before, but I have not found a way to conveniently search the archives of this mailing list. So... Can someone tell me how to...
4
by: | last post by:
Hello... i have a table which contains a column named "ask" and a column named "per"... my think is that i want to search in "ask" and echo the data stored in "per" for this entry... How do i do...
7
gregerly
by: gregerly | last post by:
Hello, I've got a problem with a website search function. PHP for the front end, MySQL for the backend. The search function searches a field of keywords. The problem I'm having is that when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.