nextcloud16 es7.3 全文检索

nextcloud16 es7.3 全文检索

nextcloud 安装3个app 插件

Full text search
Full text search - Elasticsearch Platform
Full text search - Files

设置插件

设置->全文检索->Servelet地址:http://localhost:9200/
设置->全文检索->[高级] 分析器tokenizer: ik_smart

安装ES插件

# ingest-attachment
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

#安装IK分词
/usr/share/elasticsearch/bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.3.0/elasticsearch-analysis-ik-7.3.0.zip

初始化索引

cd /var/www
sudo -u nginx ./occ fulltextsearch:index

创建并启动服务

由于全文索引需要不停的进行(因为有新的文件进来),做成centos服务

vi /etc/systemd/system/nextcloud-fulltext-elasticsearch-worker.service
修改目录 user group 内容 

[Unit]
Description=Elasticsearch Worker for Nextcloud Fulltext Search
After=network.target

[Service]
User=nginx
Group=nginx
WorkingDirectory=/var/www
ExecStart=/usr/bin/php /var/www/occ fulltextsearch:live -q
ExecStop=/usr/bin/php /var/www/occ fulltextsearch:stop
Nice=19
Restart=always

[Install]
WantedBy=multi-user.target
#开机启动
systemctl enable nextcloud-fulltext-elasticsearch-worker
systemctl start nextcloud-fulltext-elasticsearch-worker

问题

pipeline with id [attachment] does not exist

│ Error:      2/2
│ Index: files:478
│ Exception: Elasticsearch\Common\Exceptions\BadRequest400Exception
│ Message: pipeline with id [attachment] does not exist

重建索引
cd /var/www
sudo -u nginx ./occ fulltextsearch:reset
sudo -u nginx ./occ fulltextsearch:index

Search platform (Elasticsearch) down ?

启动ES systemctl start elasticsearch ,当然你需要稍微等一下他启动

In IndexService.php line 253: please add ingest-attachment plugin to elasticsearch

In IndexService.php line 253:
  please add ingest-attachment plugin to elasticsearch 

安装插件
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

The current PHP memory limit is below the recommended value of 512MB

编辑php.ini
memory_limit = 512M

php The posix extensions are required

yum install php-process -y

参考

  • https://github.com/nextcloud/fulltextsearch/wiki/Basic-Installation

你可能感兴趣的:(运维)