解决了Drupal的中文搜索问题!

Drupal自带的搜索功能无法实现非西方语言的站内搜索,可能是由于Drupal Search Indexing不支持的Unicode的缘故,以前有不少人试图修改search.module或是node.module来实现中文搜索功能,但是效果都不好。但是trip_search.module解决了这个问题,其实实现的原理很简单,使用 SQL Like 命令取代了Drupal Search Indexing,直接进行数据库搜索,避开了Drupal Search Indexing的问题。虽然这种搜索方式理论上可能会比原搜索方式慢一些,但是实际上问题不大。trip_search.module既可以作为block的形式出现在页面,也可以通过"?q=trip_search/my_keywords_here" 访问,也就是说可以和原先的search.module一样放在primary link里。所以确实是一个很不错的选择:)

Comments

呵呵, Just very very tiny m

呵呵, Just very very tiny modification in search.module can do the trick.

hehe,I tried several ways to modify it...

But it turns out that the trip_search.module is a better solution because once you modified the code of search.module, some unexpected problem may occur. hehe, using trip_search.module is relatively more convinient.:)

trip_search

想请教怎样"enable MySQL full text indexing, by running the sql in full_text_indices.mysql"? trip_search 的作者说要先enable这个档案,然后trip_search的module才能用。

我不太懂这些技术性问题,请问怎样去enable,希望大家指点,多给些详细的指引。谢谢。

呵呵,现在其实没有

呵呵,现在其实没有必要用 trip search 了啊,Drupal 自带的search 模块已经可以完美的搜索中文了,为什么不勇Drupal 自己的搜索呢?

想问问highlight_module

真的奇怪。昨天刚set up drupal就不能搜寻中文--虽然我已经用了cron更新了, 但是今天又可以搜寻?

如果不介意,再想请教你一个问题。我现在也用highlight_module。搜寻了以后,英文字就有highlight,但中文就没有。想请问有什么解决方法。

谢谢你。

你必须等待 Drupal

你必须等待 Drupal 完全 Index 了你的网站才能搜索中文,Index 的状态可以在 管理-〉设置-〉搜索 中查看,这个 Indexing 是通过 cron 来完成的。

呵呵,我没有用 Highlight 模块啊,这个搜索后的 highlight 是搜索模块自带的,你可以利用 css 把它调节成你需要的效果。

kzeng

kzeng wrote:

呵呵,我没有用 Highlight 模块啊,这个搜索后的 highlight 是搜索模块自带的,你可以利用 css 把它调节成你需要的效果。

可惜我不懂programming。但如果你能告诉我在哪里可以更改什么code,有较详细的指引,那么我还可以跟着做。当然,这样会麻烦你了。

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.