Re: Search not working
Christian Stocker <[email protected]>
| Newsgroups | gmane.comp.cms.bitflux.general |
|---|---|
| Message-ID | <[email protected]> |
On 24.7.2005 13:21 Uhr, Mark Jarecki wrote:
> Just adding to my earlier observations I noticed that
> http://devblog.flux-cms.org/ has the same problem with Search as I do.
>
> I.e. type in the word "soon" (a word found within the text of the BLOG
> entry) into the form and you get the "Nothing Found" message.
LiveSearch uses MySQL's Fulltext search and you have to understand, how
the MySQL fulltext search works to know why it sometimes doesn't produce
any results.
>From http://dev.mysql.com/doc/mysql/en/fulltext-search.html:
***
Such a technique works best with large collections (in fact, it was
carefully tuned this way). For very small tables, word distribution does
not adequately reflect their semantic value, and this model may
sometimes produce bizarre results. For example, although the word
``MySQL'' is present in every row of the articles table, a search for
the word produces no results:
mysql> SELECT * FROM articles
-> WHERE MATCH (title,body) AGAINST ('MySQL');
Empty set (0.00 sec)
The search result is empty because the word ``MySQL'' is present in at
least 50% of the rows. As such, it is effectively treated as a stopword.
For large datasets, this is the most desirable behavior---a natural
language query should not return every second row from a 1GB table. For
small datasets, it may be less desirable.
***
There's also a stopword list built in in mysql. So either "soon" is in
the stopword list, or it's too common. The same is the case for "your"
in your test. And the fulltext search doesn't work well, if you have
very little entries (like the one test entry). If the word's in the
title (and not in the content of the post), it should be found anyway,
since we're searching the title field without FULLTEXT, if nothing was
found in the fulltext search.
If you want to use different search techniques for LiveSearch, you can
hand-tune inc/bx/php/livesearch.php. It's a very simple php script :)
chregu
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | [email protected] | gnupg-keyid 0x5CE1DECB
--
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms