dbTalk Databases Forums  

MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE)

comp.databases.mysql comp.databases.mysql


Discuss MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ignoramus495
 
Posts: n/a

Default MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) - 08-08-2012 , 02:35 PM






Something strange is happening. I have a search index on a particular
column.

If I search with MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE)
I do not find any records. However, the records are there:

aisql "select ebay_title from inventory" | grep -i ' fan '
Used Fasco 1/3 HP Industrial Floor Fan Motor
New, GE 1.5-2HP HVAC fan blower motor Model #5K49MN4250FZ
.... ... ...
NEW,HAYDEN ELECTRIC FAN MOTOR 021386 FORKLIFT HEATER FAN

If I search the same table the same way, but for another word
"alternator", mysql finds plenty of records.

My question is, why doesn't it find 'fan', but does find 'alternator',
when both are present? Is "fan" somehow a stop word?

Reply With Quote
  #2  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) - 08-08-2012 , 04:10 PM






On 8/8/2012 3:35 PM, Ignoramus495 wrote:
Quote:
Something strange is happening. I have a search index on a particular
column.

If I search with MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE)
I do not find any records. However, the records are there:

aisql "select ebay_title from inventory" | grep -i ' fan '
Used Fasco 1/3 HP Industrial Floor Fan Motor
New, GE 1.5-2HP HVAC fan blower motor Model #5K49MN4250FZ
... ... ...
NEW,HAYDEN ELECTRIC FAN MOTOR 021386 FORKLIFT HEATER FAN

If I search the same table the same way, but for another word
"alternator", mysql finds plenty of records.

My question is, why doesn't it find 'fan', but does find 'alternator',
when both are present? Is "fan" somehow a stop word?

The default minimum word length for fulltext searches is 4 characters.
'fan' is only 3 characters.

You can change this in your mysql config file. See
http://dev.mysql.com/doc/refman/5.6/...t-boolean.html for more info.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #3  
Old   
Ignoramus495
 
Posts: n/a

Default Re: MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) - 08-08-2012 , 08:20 PM



On 2012-08-08, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote:
Quote:
On 8/8/2012 3:35 PM, Ignoramus495 wrote:
Something strange is happening. I have a search index on a particular
column.

If I search with MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE)
I do not find any records. However, the records are there:

aisql "select ebay_title from inventory" | grep -i ' fan '
Used Fasco 1/3 HP Industrial Floor Fan Motor
New, GE 1.5-2HP HVAC fan blower motor Model #5K49MN4250FZ
... ... ...
NEW,HAYDEN ELECTRIC FAN MOTOR 021386 FORKLIFT HEATER FAN

If I search the same table the same way, but for another word
"alternator", mysql finds plenty of records.

My question is, why doesn't it find 'fan', but does find 'alternator',
when both are present? Is "fan" somehow a stop word?


The default minimum word length for fulltext searches is 4 characters.
'fan' is only 3 characters.

You can change this in your mysql config file. See
http://dev.mysql.com/doc/refman/5.6/...t-boolean.html for more info.

Thanks. I just made that change, sometimes I even want to search for
one or especially two letter words (such as AB, an abbreviation for
Allen-Bradley).

In my own opinion, discriminating words by number of characters was,
so to speak, not the brightest idea.

i

Reply With Quote
  #4  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) - 08-08-2012 , 10:46 PM



On 8/8/2012 9:20 PM, Ignoramus495 wrote:
Quote:
On 2012-08-08, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote:
On 8/8/2012 3:35 PM, Ignoramus495 wrote:
Something strange is happening. I have a search index on a particular
column.

If I search with MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE)
I do not find any records. However, the records are there:

aisql "select ebay_title from inventory" | grep -i ' fan '
Used Fasco 1/3 HP Industrial Floor Fan Motor
New, GE 1.5-2HP HVAC fan blower motor Model #5K49MN4250FZ
... ... ...
NEW,HAYDEN ELECTRIC FAN MOTOR 021386 FORKLIFT HEATER FAN

If I search the same table the same way, but for another word
"alternator", mysql finds plenty of records.

My question is, why doesn't it find 'fan', but does find 'alternator',
when both are present? Is "fan" somehow a stop word?


The default minimum word length for fulltext searches is 4 characters.
'fan' is only 3 characters.

You can change this in your mysql config file. See
http://dev.mysql.com/doc/refman/5.6/...t-boolean.html for more info.


Thanks. I just made that change, sometimes I even want to search for
one or especially two letter words (such as AB, an abbreviation for
Allen-Bradley).

In my own opinion, discriminating words by number of characters was,
so to speak, not the brightest idea.

i

That's why there is a default which you can change.

IMHO, 4 characters is a reasonable value for a default. Smaller values
can greatly increase the size of the index (and therefore impact
performance), while larger values can miss a lot of words which might be
searched for.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #5  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: MATCH( mytable ) AGAINST( '+fan' IN BOOLEAN MODE) - 08-13-2012 , 02:39 AM



El 09/08/2012 3:20, Ignoramus495 escribió/wrote:
Quote:
The default minimum word length for fulltext searches is 4 characters.
'fan' is only 3 characters.

You can change this in your mysql config file. See
http://dev.mysql.com/doc/refman/5.6/...t-boolean.html for more info.

Thanks. I just made that change, sometimes I even want to search for
one or especially two letter words (such as AB, an abbreviation for
Allen-Bradley).

In my own opinion, discriminating words by number of characters was,
so to speak, not the brightest idea.
Full-text search is designed for natural language rather than literal
string search, so you can look for "houses in the French Riviera" and
find "Wonderful French Riviera house for rent".

Including words like "a", "an" or "the" normally makes it all slower and
overwhelms user with hundreds of irrelevant matches.

You can always combine both approaches ;-)


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.