内容明细
Version: AS/CE 5.6
原功能:Gforge
搜寻只能搜索英文,无法对中文进行全文检索。
需求: 提供中文全文检索功能,单独菜单进入。
解决方案:
应用新的全文检索插件,该插件集成了sphinx来完成对Gforge的中文全文检索。
插件下载:
http://gforge.retailsolution.cn:81/gf/download/frsrelease/107/275/gforgeFtSearch_linux_1.0.tar.gz
说明:无
实施步骤:
Fllow these step to install fulltextSearch for gforge
1、download and unzip
download gforgeFulltextPlugin.zip to your $gforge directory
unzip gforgeFulltextPlugin.zip
2、Excute install.sh
cd $gforge/gforgeFulltextPlugin
./install.sh
3、config Gforge database user and password in sphinx_gf.conf
cd /usr/local/sphinx/etc
vi sphinx_gf.conf
#Input your own Gforge dbname ,dbuser and password
sql_user = gforge #default is gforge
sql_pass = gforge #default is gforge
sql_db = gforge5 #default is gforge5
4、#modify pg_hba.conf
find / -name pg_hba.conf
#add:
host all all 127.0.0.1/32 trust
#reload config (usually pg_hba.conf was in directory /var/lib/pgsql/data)
pg_ctl -U postgres reload -D /var/lib/pgsql/data
5、#Creat table
psql -U postgres gforge5 #default is gforge5, if your db name is not
default , please change to you db name
gforge5# create table sph_counter (counter_id integer not null, max_doc_id
integer null);
gforge5# insert into sph_counter (counter_id,max_doc_id) values (1, 0);
gforge5# insert into sph_counter (counter_id,max_doc_id) values (2, 0);
gforge5# alter table sph_counter owner to gforge;
gforge5# \q
6、Init Index and Start sphinx demon
/usr/local/sphinx/index_gf_main.sh
/usr/local/sphinx/index_gf_delta.sh
/usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx_gf.conf
7、add period task in crontab.in to cron
crontab -e
copy lines from crontab.in to current crontab
8、add prompt in you language , Rebuild Gforge language cache
for example (in SimplifiedChinese):
cd $gforge/language
vi SimplifiedChinese.tab
#add line:
Tabs.FTSearch 全文检索
php $gforge/bin/create_lang_cache.php
|
内容明细
Version: AS/CE 5.6
原功能:Gforge
搜寻只能搜索英文,无法对中文进行全文检索。
需求: 提供中文全文检索功能,单独菜单进入。
解决方案:
应用新的全文检索插件,该插件集成了sphinx来完成对Gforge的中文全文检索。
插件下载:
http://gforge.retailsolution.cn:81/gf/download/frsrelease/107/275/gforgeFtSearch_linux_1.0.tar.gz
说明:无
实施步骤:
Fllow these step to install fulltextSearch for gforge
1、download and unzip
download gforgeFulltextPlugin.zip to your $gforge directory
unzip gforgeFulltextPlugin.zip
2、Excute install.sh
cd $gforge/gforgeFulltextPlugin
./install.sh
3、config Gforge database user and password in sphinx_gf.conf
cd /usr/local/sphinx/etc
vi sphinx_gf.conf
#Input your own Gforge dbname ,dbuser and password
sql_user = gforge #default is gforge
sql_pass = gforge #default is gforge
sql_db = gforge5 #default is gforge5
4、#modify pg_hba.conf
find / -name pg_hba.conf
#add:
host all all 127.0.0.1/32 trust
#reload config (usually pg_hba.conf was in directory /var/lib/pgsql/data)
pg_ctl -U postgres reload -D /var/lib/pgsql/data
5、#Creat table
psql -U postgres gforge5 #default is gforge5, if your db name is not
default , please change to you db name
gforge5# create table sph_counter (counter_id integer not null, max_doc_id
integer null);
gforge5# insert into sph_counter (counter_id,max_doc_id) values (1, 0);
gforge5# insert into sph_counter (counter_id,max_doc_id) values (2, 0);
gforge5# alter table sph_counter owner to gforge;
gforge5# \q
6、Init Index and Start sphinx demon
/usr/local/sphinx/index_gf_main.sh
/usr/local/sphinx/index_gf_delta.sh
/usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/sphinx_gf.conf
7、add period task in crontab.in to cron
crontab -e
copy lines from crontab.in to current crontab
8、add prompt in you language , Rebuild Gforge language cache
for example (in SimplifiedChinese):
cd $gforge/language
vi SimplifiedChinese.tab
#add line:
Tabs.FTSearch 全文检索
php $gforge/bin/create_lang_cache.php
|