This is what i need:
Posted by gogman on Monday May 5 2003, @10:42am on the mysql website:
----------------------------
MySQL defaults to an 'OR'. Example: 'dog cat' = 'dog OR cat'. Most fulltext
search engines default to an 'AND'. These include: AltaVista, Fast Search,
Google, Hotbot, Lycos, Northern Light and Yahoo. Excite is an exception that
defaults to an 'OR'.
New Feature: set-variable = ft_boolean_default='AND'
vs 'OR'
('OR' would be the default setting so as to not break older code)
With a 'AND' default 'OR' would have to be explicit. Example: 'dog cat' = 'dog
AND cat', 'dog OR cat' - requires 'OR' to be set.
Performance tests are indicating a 5-7 times increase in search speed
with "AND" vs "OR" statements.
----------------------------------------------
I have done some searches on google and found several people wanting to do the
same... but no solutions.
Quoting John thegimper <[EMAIL PROTECTED]>:
> Is there still no solution for this? Every large searchengine works like
> this.
>
> Quoting:
> >
> >
> > Hi that works fine only now if a user puts + in front of a word that
> > word
> > becomes optional = OR?
> > What i would like is the search to work exactly like before only that
> it
> >
> > defaults to AND instead of OR.
> > Almost every search engine i have tried, google etc. works like this.
> > "black horse cat dog" only show results with all words present.
> >
> > This is what i did, set global ft_boolean_syntax = ' +-><()~*:""&|'
> >
> > I really appreciate your help!!
> >
> > >From: Sergei Golubchik <[EMAIL PROTECTED]>
> > >To: Jessica Svensson <[EMAIL PROTECTED]>
> > >CC: [EMAIL PROTECTED]
> > >Subject: Re: Please help me: Boolean fulltext searches, AND instead
> of
> > OR
> > >Date: Wed, 23 Mar 2005 22:32:49 +0100
> > >
> > >Hi!
> > >
> > >On Mar 23, Jessica Svensson wrote:
> > > > Is there any way i can get results with AND instead of OR?
> > > > Trying to search for "black cat" should only return records that
> > >contains
> > > > both black and cat.
> > > >
> > > > I'm using the following code to get my result:
> > > >
> > > > SELECT * FROM `searchtbl` WHERE MATCH (text) AGAINST ('black cat'
> IN
> > > > BOOLEAN MODE);
> > > >
> > > > sure there must be an easy way to change the default word
> separator
> > to
> > >AND
> > > > instead of OR?
> > >
> > >There is. See ft_boolean_syntax variable - it defines what characters
> > is
> > >used for each operator. In particular it defines '+' for "must be
> > >present" and a space ' ' for "optionally present" words.
> > >
> > >You want to put the space first (for "must be present" words)
> > >
> > >Regards,
> > >Sergei
> > >
> > >--
> > > __ ___ ___ ____ __
> > > / |/ /_ __/ __/ __ \/ / Sergei Golubchik <[EMAIL PROTECTED]>
> > > / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
> > >/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
> > > <___/ www.mysql.com
> >
> > _________________________________________________________________
> > Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/
> >
> >
>
>
>
>
> -------------------------------------------------
> FREE E-MAIL IN 1 MINUTE!
> - [EMAIL PROTECTED] - http://www.pc.nu
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
>
>
-------------------------------------------------
FREE E-MAIL IN 1 MINUTE!
- [EMAIL PROTECTED] - http://www.pc.nu
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]