sennaの使い方がよくわかりません!→わかりました!
mysql> select count(*) from job; +----------+ | count(*) | +----------+ | 3093 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('自動車' in boolean mode); +----------+ | count(*) | +----------+ | 520 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('電気' in boolean mode); +----------+ | count(*) | +----------+ | 448 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('電気 +自動車' in boolean mode); +----------+ | count(*) | +----------+ | 168 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('電気 自動車' in boolean mode); +----------+ | count(*) | +----------+ | 800 | +----------+ 1 row in set (0.00 sec)
というときに、電気も自動車も含まない2293件を出す方法がわかりません!
mysql> select count(*) from job where match ( free_word_text ) against ('-電気 -自動車' in boolean mode); +----------+ | count(*) | +----------+ | 280 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('-電気 自動車' in boolean mode); +----------+ | count(*) | +----------+ | 800 | +----------+ 1 row in set (0.00 sec) mysql> select count(*) from job where match ( free_word_text ) against ('-電気 +自動車' in boolean mode); +----------+ | count(*) | +----------+ | 168 | +----------+ 1 row in set (0.00 sec)
という挙動を見ると、一個目に「-」をつけても無視されてるみたいな気がします。どうすればいいんでしょう?
追記
2008年07月09日 kazuhooku where NOT match 〜 って書けなかったっけ
うは!たしかにたしかに!あざーっす!
mysql> select count(*) from job where not match(free_word_text) against ('電気 自動車' in boolean mode); +----------+ | count(*) | +----------+ | 2293 | +----------+ 1 row in set (0.04 sec)
できた!senna関係ないところでポカってましたね。
→でも一個目の「-」も理解してほしいなぁ。