Toon posts:

[MySQL] Fulltext zoeken standaard op AND

Pagina: 1
Acties:

Verwijderd

Topicstarter
Hi,

ik ben bezig met de Fulltext search van MySQL.
Als ik 2 keywords opgeef, functioneert deze standaard als een OR.
Nu meen ik ergens gelezen te hebben dat je dit ook op AND kan zetten.
Maar ik kan dit nergens meer terug vinden.

Kan iemand mij helpen?

Thnx

Verwijderd

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.
Je kan natuurlijk zelf ook explode op een spatie en een string bouwen waar tussen elk woord een AND wordt geplaatst...