473,473 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Useful Relevance with FullText Boolean Mode - help

Show full header Is there any way to make relevance when using boolean
mode more useful? If not, are there plans in the Fulltext development
"todo" for making it useful?

I'm thinking of just counting the keyword occurences in records with a
PHP script somehow and using that to order the records somehow. Or doing
a non boolean fulltext search w/relevance first and then melding that in
somehow with a boolean search.

See my results below, my "peeps" are asking me for relevance/ranking -
what do I do?
Thanks.

mysql> SELECT `page`.`title` , MATCH ( `title` , `descrip` ) AGAINST (
'nasdac' IN BOOLEAN MODE ) AS Relevance FROM `page` WHERE MATCH (
`title` , `descrip` ) AGAINST ( 'nasdac' IN BOOLEAN MODE )HAVING
Relevance > 0.2 ORDER BY Relevance DESC;
+------------------------------------------------+-----------+
| title | Relevance |
+------------------------------------------------+-----------+
| Code 30 Specifications | 1 |
| Center for Aero Information (CAI) | 1 |
| nasdac Centers | 1 |
| nasdac Electronic Parts & Packaging Program | 1 |
| Report/Document Number Series | 1 |
| misskermit | 1 |
| COSMIC | 1 |
| Consolidated Operations Contract (COC) | 1 |
| Directives | 1 |
| Directory of Project Libraries | 1 |
| nasdac Technical Standards Program | 1 |
| Outstocking Handbook | 1 |
| nasdac Database (NAD) | 1 |
| nasdac test | 1 |
+------------------------------------------------+-----------+
14 rows in set (0.01 sec)
Jul 23 '05 #1
1 2432
leegold wrote:
See my results below, my "peeps" are asking me for relevance/ranking -
what do I do?


You could fetch a field as a non-boolean MATCH result, and use that for
your ordering, even if your WHERE clause limits the rows by a boolean
MATCH result.

SELECT `page`.`title`,
MATCH(`title` , `descrip`) AGAINST ('nasdac' IN BOOLEAN MODE)
AS Relevance,
MATCH(`title` , `descrip`) AGAINST ('nasdac')
AS NonBoolRelevance
FROM `page`
WHERE MATCH(`title` , `descrip` ) AGAINST ('nasdac' IN BOOLEAN MODE)
HAVING Relevance > 0.2
ORDER BY NonBoolRelevance DESC;

As for improvements to full-text searching on the horizon, I don't know
of anything, but you can keep an eye on this page and its sub-pages:
http://dev.mysql.com/doc/mysql/en/todo.html

Regards,
Bill K.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Matt W | last post by:
Hi all, I'm planning to use MySQL's full-text search for my forum system (possibly 5+ million posts). I've been playing with it a lot lately to see the performance and functionality and have...
1
by: leegold | last post by:
Given the SQL shouldn't the records be sorting by score ie. relevance? I thought if "WHERE MATCH" is used it will sort that way. Thanks mysql> SELECT `page`.`title` , MATCH ( `title` , `descrip`...
0
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
1
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
0
by: phillip.s.powell | last post by:
SELECT id, student_first_name, student_last_name, major, minor , MATCH(major, minor) AGAINST ('"mechanical engineering"') AS score FROM students WHERE MATCH(major, minor) AGAINST ('"mechanical...
0
by: Malte | last post by:
Hello there, We got a problem atm with our 20k database. Everytime we search for sth. with double quotes it takes much more longer than without. Here is what we did: mysql> SELECT COUNT(*)...
5
by: rdlowrey | last post by:
Hi, I'm pulling my hair out trying to make this work and any help would be appreciated ... When I try to move the uploaded file: move_uploaded_file($_FILES,"/var/www/vhosts/...
3
nathj
by: nathj | last post by:
Hi, I am just trying to develop a search system for my website. The PHP side of things is no trouble at all. I have also set up what I think are appropriate FULLTEXT indices on the tables I will...
1
by: Robert Nash | last post by:
!(1 && !(0 || 1)) Why is this true? I just can't see it. I would appreciate any help at all. I realise it's probably easy for you.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.