473,473 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Search with relavence using MATCH AGAINST

I've got a search running from PHP with the following SQL:

$results = mysql_query("SELECT DISTINCT ForumThread.id as threadId,
ForumThread.Subject as threadTopic,
ForumThread.ID as threadId,
ForumPost.Message as postMessage,
ForumCategory.ID as categoryId,
ForumCategory.Name as categoryName,
MATCH (ForumThread.Subject) AGAINST ('" . $search->searchText. "' IN
BOOLEAN MODE) as relevanceSubject,
MATCH (ForumPost.Message) AGAINST ('" . $search->searchText. "' IN
BOOLEAN MODE) as relevanceMessage
FROM (ForumCategory
RIGHT JOIN ForumThread ON ForumCategory.ID = ForumThread.CategoryID)
LEFT JOIN ForumPost ON ForumThread.ID = ForumPost.ThreadID
ORDER BY relevanceMessage DESC, relevanceSubject DESC
LIMIT 0, 10");

There are a few things I want to ask:
I want to get relevance by adding (2 * relevanceSubject +
relevanceMessage), this would produce a better sort
Jul 19 '05 #1
0 1633

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

Similar topics

2
by: ++Captain Tripps++ | last post by:
I am trying to run a fuultext search on two identical tables and use UNION to join the results but no matter what I try, I get a syntax error on the UNION clause. Here's the query: (SELECT...
0
by: Josh | last post by:
I've got a search running from PHP with the following SQL: $results = mysql_query("SELECT DISTINCT ForumThread.id as threadId, ForumThread.Subject as threadTopic, ForumThread.ID as threadId,...
2
by: TK | last post by:
i have a some_table with 100,000 rows with and average of 500 words in some_column of each row. when i do a fulltext search on this table using a query such as SELECT something FROM some_table...
0
by: Phil Powell | last post by:
I have a rather complicated query with a combination of LEFT JOINs and two MATCHES where the first match is non-boolean to get the accurate score, the second to search as boolean: SELECT...
0
by: doug | last post by:
I am doing a search now where I have a statement "FirstName LIKE '%$firstname%' OR JobTitle LIKE '%$jobtitle%' how can I do the same statement using full text search, for example with fulltext I...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
2
by: Zeya | last post by:
I have an application where I am required to run a full text query. My database is MySQL and code in C#. The way all queries are SELECT * FROM table WHERE firstname = ? and using command...
3
by: Russell | last post by:
Hey, ok i have numerous tables to search through for a 'site search'. some of the searchble fields have html embeded within so after some quick referencing, saw I can use the regExp function...
1
by: codferrow | last post by:
Hello, I have a small issue with a web-search engine I'm working on. The main table is constantly growing (1 insert per second, currently 150 000 records) and it has full-text indexes on 2 fields...
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...
0
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,...
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
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...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
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
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...

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.