hightman / xunsearch

免费开源的中文搜索引擎,采用 C/C++ 编写 (基于 xapian 和 scws),提供 PHP 的开发接口和丰富文档
http://www.xunsearch.com
Other
1.64k stars 391 forks source link

XS安装在独立的服务器上如何连接? #104

Open hjy2588818 opened 5 years ago

hjy2588818 commented 5 years ago

请教一个问题 网站和数据库在A服务器,xunsearch安装在B服务器,A如何连接查询B的xunsearch?

hjy2588818 commented 5 years ago

因为重建索引的那段时间,会导致IO跑满,影响了WEB服务,所以单独一台机器

TangMonk commented 5 years ago

貌似只能单机上运行,没有看到相关的文档。 我重建索引也会让io跑满,服务器会卡一段时间。

希望配置文件可以这样写:

project.name = 1
server.index = 192.168.1.103:8384
server.search = 192.168.1.103:8385

[id]
type = id

这样的话就不仅仅局限于localhost

TangMonk commented 5 years ago

https://github.com/hightman/xunsearch/blob/master/sdk/php/lib/XSServer.class.php#L457

他这里写死了,就只连接localhost。。。

应该改改就能用。问题不大

要不就用elasticsearch,这个比较完美,支持多机集群

hightman commented 5 years ago

谁说写死了?那段代码的意思是只写了端口号的话默认是 localhost 当然支持写IP、域名,甚至 unix:///tmp/socket unix:///tmp/socket Best Regards

hightman/海鳗


微信/微博:hightman Github:https://github.com/hightman http://github.com/hightman

在 2019年9月18日,下午1:43,David Wu <notifications@github.com mailto:notifications@github.com> 写道:

https://github.com/hightman/xunsearch/blob/master/sdk/php/lib/XSServer.class.php#L457 https://github.com/hightman/xunsearch/blob/master/sdk/php/lib/XSServer.class.php#L457 他这里写死了,就只连接localhost。。。

应该改改就能用。问题不大

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hightman/xunsearch/issues/104?email_source=notifications&email_token=AAGGKXIPMZSCKPSCEGO2PIDQKG5ZXA5CNFSM4IXVQKI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD663XDI#issuecomment-532528013, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGGKXLYGNDQCYQ2GWGJRNTQKG5ZXANCNFSM4IXVQKIQ.

TangMonk commented 5 years ago

@hightman 我的锅,代码没看清楚。

配置文件可以直接写:

project.name = 1
server.index = 192.168.1.103:8384
server.search = 192.168.1.103:8385

[id]
type = id

https://github.com/hightman/xunsearch/blob/master/sdk/php/lib/XSServer.class.php#L469

TheBlueSkim commented 4 years ago

配置文件里 可以直接对server.index和server.search进行配置。 甚至于 你可以把索引服务器和查询服务器分开,虽然这很不ok