自托管搜索引擎,您可以用于静态博客或您想要搜索功能的任何其他网站。
我的实时实例位于http://search.cweiske.de/,并索引我的网站,博客和所有链接的URL。
foo bar搜索foo AND barfoo OR bartitle:foo仅在页面标题中搜索foobefore:2016-08-30修改日期after:2016-08-30在那天之后进行了修改date::2016-08-30精确修改日比赛foo bar site:example.org/dir/site获取参数: /?q=foo&site=example.org/dir &site = example.org/dirgearman-job-server ,而不是gearman-server )gearadmin指挥系列工具( gearman-tools软件包)安装并运行Elasticsearch和Gearman
安装php-gearman和gearman-tools
获取代码的本地副本:
$ git克隆https://git.cweiske.de/phinde.git phinde
通过作曲家安装依赖项:
$作曲家安装-NO-DEV
将您的Web服务器的文档根指向Phinde的www目录
将data/config.php.dist复制到data/config.php并进行调整。确保将您的域添加到爬行白名单中。
创建一个MySQL数据库,然后从data/schema.sql导入架构
运行设置Elasticsearch模式的bin/setup.php
将您的主页放入队列:
$ ./bin/process.php http://example.org/
启动至少一个工人处理爬网+索引队列:
$ ./bin/phinde-worker.php
在浏览器中查看Phinde的状态页面。开放任务的数量应为> 0,工人的数量也应为0。
当您的网站更改时,搜索引擎需要重新爬行并重新索引页面。
只需告诉Phinde,跑步改变了某些事情:
$ ./bin/process.php http://example.org/foo.htm
Phinde支持HTML页面和原子供稿,因此,如果您的博客有一个供稿,则足以让Phinde Reindex那个。它将自动找到所有链接页面。
将简单的搜索表添加到您的网站很容易。它需要两件事:
<form>标签带指向phinde实例的动作q 。例子:
<形式method =“ get” action =“ http://phinde.example.org”> <输入type =“ text” name =“ q”占位符=“搜索文本”/> <button type =“提交”>搜索</button> </form>
使用SystemD时,您可以在系统启动时使其运行多个工人实例:
复制文件data/systemd/phinde*.service服务为/etc/systemd/system/
调整用户和组名称以及工作目录
启用三个工作流程:
$ Systemctl守护程序 - 重加载 $ systemctl启用phinde@1 $ systemctl启用phinde@2 $ systemctl启用phinde@3 $ Systemctl启用Phinde $ systemctl开始phinde
现在三名工人正在跑步。重新启动phinde服务还可以重新启动工人。
每天使用Cron运行一次bin/renew-subscriptions.php 。它将续签WebSUB订阅。
从一个域中删除索引数据:
$ curl -iv -xdelete -h'content -type:application/json'-d'{“ query”:{“ term”:{“ domain':”
那是Delete-by-Query 2.0,请参阅https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/delete-by-query-usage.html
Phinde支持WebSub,以订阅网站的更改。当Phinde被网站的枢纽通知有关更改时,它将立即爬网并索引更改的页面。
订阅网站的提要:
$ php bin/subscribe.php http://example.org/feed.atom
Phinde将确定网站的枢纽,并向其发送注册请求。
状态页面将显示工作数和开放订阅的数量。
取消订阅也发生在命令行:
$ php bin/unsubscribe.php http://example.org/feed.atom
Phinde的源代码可从http://git.cweiske.de/phinde.git或github上的镜像获得。
Phinde在AGPL V3或更高版本下获得许可。
Phinde是由克里斯蒂安·韦斯克(Christian Weiske)撰写的。