473,750 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ 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 2450
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 NonBoolRelevanc e
FROM `page`
WHERE MATCH(`title` , `descrip` ) AGAINST ('nasdac' IN BOOLEAN MODE)
HAVING Relevance > 0.2
ORDER BY NonBoolRelevanc e 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
1286
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 some suggestions/questions. First, since a few of you may be wanting to know, here is a thread where I was doing some speed/optimization tests and stuff with 3 million posts: http://www.sitepointforums.com/showthread.php?threadid=69555
1
6174
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` ) AGAINST ( '+code+nasdac' IN BOOLEAN MODE ) AS SCORE FROM `page` WHERE MATCH ( `title` , `descrip` ) AGAINST ( '+code+nasdac' IN BOOLEAN MODE ); +---------------------------------------------+-----------------+ | title | SCORE |...
0
1425
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). I'm using MySQL 4.2.x. Here's my dilemma. 1) --------- I have two tables that have records with a FULLTEXT index text field in each of them. The problem is the relationship between the tables is a
1
2424
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). I'm using MySQL 4.2.x. Here's my dilemma. 1) --------- I have two tables that have records with a FULLTEXT index text field in each of them. The problem is the relationship between the tables is a
0
1260
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 engineering"' IN BOOLEAN MODE) GROUP BY id, student_first_name, student_last_name, major, minor, score ORDER BY score DESC This query in MySQL 4.1.12 using MyISAM tables with FULLTEXT index that
0
1538
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(*) FROM `Pages` WHERE MATCH (`Text`) AGAINST ('"term"' IN BOOLEAN MODE); +----------+ | COUNT(*) | +----------+
5
3332
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/ mydomain.com/intranet/httpdocs/lib/slips/in/$filename.pdf"); I get the following error: Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10001 is not allowed to access /var/www/vhosts/
3
1399
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 need to search. I was just trying things out and have got a bit confused. What I think should be happening, based on what I've read, is not happening. I have a table - tbl_resource, on this table there is FULLTEXT index on three fields -...
1
2251
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
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9339
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6804
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3322
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 we have to send another system
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.