[前][次][番号順一覧][スレッド一覧]

mysql:7863

From: Yoshitaka Ishiguro <Yoshitaka Ishiguro <ishi@xxxxxxxxxx>>
Date: Mon, 02 Jun 2003 14:59:39 +0900
Subject: [mysql 07863] Re: FULLTEXT 型の検索漏れ ?

石黒です。
自己レス&解決です。

FULLTEXT型でインデックスを作って、検索漏れがあるのではと以前書き
ましたが、

マニュアルをよく読みますと、
Every correct word in the collection and in the query is weighted according to its significance in the query or collection. This way, a word that is present in many documents will have lower weight (and may even have a zero weight), because it has lower semantic value in this particular collection. Otherwise, if the word is rare, it will receive a higher weight. The weights of the words are then combined to compute the relevance of the row. 

Such a technique works best with large collections (in fact, it was carefully tuned this way). For very small tables, word distribution does not reflect adequately their semantic value, and this model may sometimes produce bizarre results. 

mysql> SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('MySQL');
Empty set (0.00 sec)

The search for the word MySQL produces no results in the above example, because that word is present in more than half the rows. As such, it is effectively treated as a stopword (that is, a word with zero semantic value). This is the most desirable behaviour -- a natural language query should not return every second row from a 1GB table. 


とありました。
よく出てくる単語は引っかからないようにする仕様であることに気づきました。

マニュアルをよく読まずに投稿してしまい、失礼しました。


> RedHat7.3 + MySQL4.0.12 の環境を構築しています。
> myISAMのテーブルに200万件程度のレコードがあります。
> テーブルに、FULLTEXT型のカラムを作成し、
> 
> aa varchar(128)
> bb text
> cc text
> 
> bbのカラムに"Tom cat is ...."というデータが入っています。
> 
> select * from test_t where MATCH(aa,bb,cc) AGAINST('Tom');
> とやった場合には引っかかるのですが、
> select * from test_t where MATCH(aa,bb,cc) AGAINST('cat');
> とやった場合には引っかかりません。
> 
> show keys from test_tをみても特に異常はありませんでした。
> 
> 大文字小文字の区別は全部確認しました。
> optimize tableもしてあります。
> myisamchkもしましたが特にエラーは出ていませんでした。
> 
> これはMySQLのインデックスの作成がおかしいのでしょうか?
> 
> よろしくお願いします。



[前][次][番号順一覧][スレッド一覧]

      7812 2003-05-23 12:29 [Yoshitaka Ishiguro <] FULLTEXT 型の検索漏れ ?                 
->    7863 2003-06-02 14:59 ┗[Yoshitaka Ishiguro <]