Re: More questions about Fulltext searching.

2001-06-28 Thread Matthew Brealey

 --- Stoyan [EMAIL PROTECTED] wrote:  hi,
 
 why don't you try to use this:
 
 SELECT * FROM BOOK WHERE author LIKE '%charles%dickens%';

That query takes 6.4 seconds. My query (MATCH author AGAINST ('charles')
and match author against('dickens')) takes 1.3 seconds. Fulltext searching
is MUCH more efficient.

=



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: More questions about Fulltext searching.

2001-06-27 Thread Nessi


Hi

I have posted this before. You can do an AND search by using the IF() 
function.
Its messy in the query but it works.
Here an example of my select query - 3 inputs are checked as AND:


SELECT author, title, year, recommend, copy, publ_desc, publ_loc, 
CEILING(IF(MATCH author AGAINST ( 'Adams')  0, IF(MATCH title AGAINST 
('Places')  0, IF(MATCH publ_desc AGAINST ('Society')  0, (MATCH author 
AGAINST ('Adams') + MATCH title AGAINST ('Places') + MATCH publ_desc 
AGAINST ('Society')), 0), 0), 0)) as x FROM books, publ WHERE publ_id = 
pub_id ORDER BY x DESC

Hope this helps!

Cheers, Nessi


At 22:22 26/06/01 , you wrote:
Ok,

The message set that I noticed this morning sparked my interest in this.
Currently I'm developing a search engine that will utilize mysql's
fulltext match technology. The problem that i've run into is, I can't
seem to find any documentation on how to force an AND search with in
MATCH AGAINST syntax, As far as I can tell this is `OR' only. Has is
there
an option to force AND? If so could this please be appended to the
manual
under the `MySQL Full-text Search' section. Thanks.

-
Before posting, please check:
http://www.mysql.com/manual.php  (the manual)
http://lists.mysql.com/  (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: More questions about Fulltext searching.

2001-06-27 Thread Matthew Brealey

 --- Colin Faber [EMAIL PROTECTED] wrote: 
 Ok, 
 
 The message set that I noticed this morning sparked my interest in this.
 
 Currently I'm developing a search engine that will utilize mysql's 
 fulltext match technology. The problem that i've run into is, I can't
 seem to find any documentation on how to force an AND search with in
 MATCH AGAINST syntax, As far as I can tell this is `OR' only. Has is
 there
 an option to force AND? 

Sadly not. I've had the same trouble as you with this. It's mentioned
somewhere
(http://www.mysql.com/doc/F/u/Fulltext_Features_to_Appear_in_MySQL_4.0.html)
that this will be in v4; until then, no chance.

The way I do this is to split queries into words and do AND.

So to find charles dickens:

SELECT * FROM BOOK WHERE MATCH author AGAINST ('charles') AND MATCH author
AGAINST ('dickens')

If anyone knows how to make 'charles dickens' match simply fields
containing both those words, rather than one or the other (ordering by
score helps, but still the last results would be irrelevant), please
enlighten me.

=



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re again: More questions about Fulltext searching.

2001-06-27 Thread Nessi

Hello Matthew,

I posted this earlier today but maybe you didnt get the message.
This definitely works for me, and its definitely an AND search (example):

SELECT author, title, year, recommend, copy, publ_desc, publ_loc, 
CEILING(IF(MATCH author AGAINST ( 'Adams')  0, IF(MATCH title AGAINST 
('Places')  0, IF(MATCH publ_desc AGAINST ('Society')  0, (MATCH author 
AGAINST ('Adams') + MATCH title AGAINST ('Places') + MATCH publ_desc 
AGAINST ('Society')), 0), 0), 0)) as x FROM books, publ WHERE publ_id = 
pub_id ORDER BY x DESC

Its messy and you will need to split the words if you only use 1 entry 
field (I use 3 different ones).
But that shouldnt be a problem in php with explode function (even for 
whitespaces).
You then need a function to create the seperate parts according to the 
number of
the words. Even this example select query is only from a test file, my 
original file
sets the whole query together in a php process.
as x will give only more than 0% if all three words apply.
So you only need a function in your script reading out the rows with x  0.

See also the IF() section in the mysql manual...thats how I came up with 
this query.

Hope this helps

Cheers, Nessi



At 17:08 27/06/01 , you wrote:
  --- Colin Faber [EMAIL PROTECTED] wrote:
  Ok,
 
  The message set that I noticed this morning sparked my interest in this.
 
  Currently I'm developing a search engine that will utilize mysql's
  fulltext match technology. The problem that i've run into is, I can't
  seem to find any documentation on how to force an AND search with in
  MATCH AGAINST syntax, As far as I can tell this is `OR' only. Has is
  there
  an option to force AND?

Sadly not. I've had the same trouble as you with this. It's mentioned
somewhere
(http://www.mysql.com/doc/F/u/Fulltext_Features_to_Appear_in_MySQL_4.0.html)
that this will be in v4; until then, no chance.

The way I do this is to split queries into words and do AND.

So to find charles dickens:

SELECT * FROM BOOK WHERE MATCH author AGAINST ('charles') AND MATCH author
AGAINST ('dickens')

If anyone knows how to make 'charles dickens' match simply fields
containing both those words, rather than one or the other (ordering by
score helps, but still the last results would be irrelevant), please
enlighten me.

=



Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

-
Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




More questions about Fulltext searching.

2001-06-26 Thread Colin Faber

Ok, 

The message set that I noticed this morning sparked my interest in this. 
Currently I'm developing a search engine that will utilize mysql's 
fulltext match technology. The problem that i've run into is, I can't
seem to find any documentation on how to force an AND search with in
MATCH AGAINST syntax, As far as I can tell this is `OR' only. Has is
there
an option to force AND? If so could this please be appended to the
manual
under the `MySQL Full-text Search' section. Thanks.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php