473,385 Members | 1,282 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,385 software developers and data experts.

MATCH - AGAINST query issue

Hi, I've set up the following table in MySQL 3.23.58 and all seemed to be
working fine:

CREATE TABLE advert (
id INT NOT NULL AUTO_INCREMENT,
userid INT NOT NULL,
make VARCHAR(25) NOT NULL,
model VARCHAR(15) NOT NULL,
year VARCHAR(4) NOT NULL,
price FLOAT(7,2) NOT NULL,
colour VARCHAR(20) NOT NULL,
description TEXT NOT NULL,
county VARCHAR(25) NOT NULL,
approval BIT,
end DATE,
PRIMARY KEY (id),
KEY (make,price),
FULLTEXT(make,model,year,colour,description,county )
);

.... I then added some cars from my PHP front end and started using the
following query:

SELECT * from advert, WHERE end >= CURDATE() AND approval ='1';

It worked

I then wanted to add a keyword search field (hence the FULLTEXT) so changed
by query to:

SELECT * from advert WHERE end >= CURDATE() AND approval ='1' AND MATCH
(make,model,year,colour,description,county) AGAINST ('keyword');

Here I started having problems, here is a sample description for one of my
(6) cars:

Metallic Blue Golf GTi. 153K Miles. FFSR. New exhaust. New front disks and
pads. Kenwood CD player. Detachable parchel shelf. Great car.

If I make the keyword '153k', 'disks', 'shelf', 'pads' etc it works. If
Imake it 'cd', 'front', 'car', 'gti' it doesn't

I have had a look through the other cars/descriptions and realised that the
words that don't work are those that appear elsewhere on different listings.

i.e. my query is unhappy producing more han one result

Can someone please explain why and how to fix this

Cheers
Jul 20 '05 #1
9 2585
Can someone please explain why and how to fix this


After ages of looking at it I've just read something

My problem is a combination of two things

1. < 3 char searches
2. The 50% rule

Soz to waste your time ...
Jul 20 '05 #2
2. The 50% rule


Is there a way I can tell (via PHP) that no result was returned due to the
50% rule or due to their being no records that match the criteria?

Many thanks
Jul 20 '05 #3
Sorry I don't have an answer, I have a question! What's the 50% rule?
(sorry, semi-noob!)
--ScareCrowe
"Aaron Whiffin" <aa***@nospam.com> wrote in message
news:0K***************@newsfe2-gui.ntli.net...
2. The 50% rule


Is there a way I can tell (via PHP) that no result was returned due to the
50% rule or due to their being no records that match the criteria?

Many thanks



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #4
Sorry I don't have an answer, I have a question! What's the 50% rule?
(sorry, semi-noob!)


If a query produces a result set larger than 50% of the total data set then
it is displayed as empty (i.e. no results)

You can override this with IN BOOLEAN MODE but I'm using MySQL 3.23.58 which
doesn't support this.

So I need to know if an empty result set is empty of retruned as empty as
it's too large ....
Jul 20 '05 #5
Sorry I don't have an answer, I have a question! What's the 50% rule?
(sorry, semi-noob!)


If a query produces a result set larger than 50% of the total data set then
it is displayed as empty (i.e. no results)

You can override this with IN BOOLEAN MODE but I'm using MySQL 3.23.58 which
doesn't support this.

So I need to know if an empty result set is empty of retruned as empty as
it's too large ....
Jul 20 '05 #6
Couldn't you write a similar query, just adding "LIMIT 1" or something, and
see if that is empty? If it is, then the other would be empty because of no
result, otherwise because the result set was too large...
"Aaron Whiffin" <aa***@nospam.com> skrev i melding
news:zM************@newsfe5-win.ntli.net...
Sorry I don't have an answer, I have a question! What's the 50% rule?
(sorry, semi-noob!)
If a query produces a result set larger than 50% of the total data set

then it is displayed as empty (i.e. no results)

You can override this with IN BOOLEAN MODE but I'm using MySQL 3.23.58 which doesn't support this.

So I need to know if an empty result set is empty of retruned as empty as
it's too large ....

Jul 20 '05 #7
Couldn't you write a similar query, just adding "LIMIT 1" or something, and
see if that is empty? If it is, then the other would be empty because of no
result, otherwise because the result set was too large...
"Aaron Whiffin" <aa***@nospam.com> skrev i melding
news:zM************@newsfe5-win.ntli.net...
Sorry I don't have an answer, I have a question! What's the 50% rule?
(sorry, semi-noob!)
If a query produces a result set larger than 50% of the total data set

then it is displayed as empty (i.e. no results)

You can override this with IN BOOLEAN MODE but I'm using MySQL 3.23.58 which doesn't support this.

So I need to know if an empty result set is empty of retruned as empty as
it's too large ....

Jul 20 '05 #8

"Hans Christoffer Johansen" <os*******@hotmail.com> wrote in message
news:dD******************@news4.e.nsc.no...
Couldn't you write a similar query, just adding "LIMIT 1" or something, and see if that is empty? If it is, then the other would be empty because of no result, otherwise because the result set was too large...


Oh you wanna rematch huh?

Sounds like that would do the trick to me!


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #9

"Hans Christoffer Johansen" <os*******@hotmail.com> wrote in message
news:dD******************@news4.e.nsc.no...
Couldn't you write a similar query, just adding "LIMIT 1" or something, and see if that is empty? If it is, then the other would be empty because of no result, otherwise because the result set was too large...


Oh you wanna rematch huh?

Sounds like that would do the trick to me!


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #10

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

Similar topics

8
by: vze29xhy | last post by:
I have searched the existing responses in this forum and others and could not find a solution. I have a database on MySQL server Version "4.0.13". My table structure is as follows TABLE1:MusicCD...
3
by: Aaron Whiffin | last post by:
Hi, I've set up the following table in MySQL 3.23.58 and all seemed to be working fine: CREATE TABLE advert ( id INT NOT NULL AUTO_INCREMENT, userid INT NOT NULL, make VARCHAR(25) NOT NULL,...
0
by: Glenn Fleishman | last post by:
I'm trying to perform a search that I can't find any information about in MySQL's manuals, discussion groups, or on the Web. I'm used to using BerkeleyDB's Btree, so I can browse to find the...
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...
4
by: jmdaviault | last post by:
I want to do the equivalent of SELECT id from TABLE WHERE text='text' only fast solution I found is: SELECT id,text from TABLE WHERE MATCH(text) AGAINST('value' IN BOOLEAN MODE) HAVING...
3
by: Hrvoje Niksic | last post by:
I often have the need to match multiple regexes against a single string, typically a line of input, like this: if (matchobj = re1.match(line)): ... re1 matched; do something with matchobj ......
6
by: lawrence k | last post by:
Wierd. Go to this page: http://www.ihanuman.com/search.php and search for "yoga" This query gets run: SELECT * FROM albums WHERE MATCH(name,description) AGAINST ('yoga') ORDER BY id DESC
1
by: Pythor | last post by:
OK I'm trying to create a sql query on our as400. I have a main table like this: acct prf acct no. sku AAA 123 ABCD AAA 123 XYZ I have...
1
by: Chris L. | last post by:
Imagine a situation where a customer buys products and is awarded free articles if s/he buys predefined sets of products. For example if s/he buys twenty articles, among them a "cereal bowl", a...
1
by: socc16e | last post by:
I have an excel sheet that I have imported into SQL 2000 and I need to match the values in one to the values in another and have them output the matching codes to a separate table or file. After...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.