I’ve just installed FullTextSearch following these guides:
https://github.com/nextcloud/fulltextsearch/wiki/Basic-Installation
https://fribeiro.org/tech/2018/02/07/nextcloud-full-text-elasticsearch/
and I’m having 2 issues:
A. The Live index service is not working.
I have created the file:
/etc/systemd/system/nextcloud-fulltext-elasticsearch-worker.service
with this content:
[Unit]
Description=Elasticsearch Worker for Nextcloud Fulltext Search
After=network.target
[Service]
User=apache
Group=apache
WorkingDirectory=/var/www/html/nextcloud
ExecStart=/usr/bin/php /var/www/html/nextcloud/occ fulltextsearch:live
Nice=19
Restart=always
[Install]
WantedBy=multi-user.target
and this is the output of systemctl:
# systemctl status nextcloud-fulltext-elasticsearch-worker.service -l
● nextcloud-fulltext-elasticsearch-worker.service - Elasticsearch Worker for Nextcloud Fulltext Search
Loaded: loaded (/etc/systemd/system/nextcloud-fulltext-elasticsearch-worker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2018-06-07 18:00:35 CEST; 1h 4min ago
Process: 2178 ExecStart=/usr/bin/php /var/www/html/nextcloud/occ fulltextsearch:live (code=exited, status=217/USER)
Main PID: 2178 (code=exited, status=217/USER)
Jun 07 18:00:35 vm-nextcloud systemd[1]: nextcloud-fulltext-elasticsearch-worker.service: main process exited, code=exited, status=217/USER
Jun 07 18:00:35 vm-nextcloud systemd[1]: Unit nextcloud-fulltext-elasticsearch-worker.service entered failed state.
Jun 07 18:00:35 vm-nextcloud systemd[1]: nextcloud-fulltext-elasticsearch-worker.service failed.
Jun 07 18:00:35 vm-nextcloud systemd[1]: nextcloud-fulltext-elasticsearch-worker.service holdoff time over, scheduling restart.
Jun 07 18:00:35 vm-nextcloud systemd[1]: start request repeated too quickly for nextcloud-fulltext-elasticsearch-worker.service
Jun 07 18:00:35 vm-nextcloud systemd[1]: Failed to start Elasticsearch Worker for Nextcloud Fulltext Search.
Jun 07 18:00:35 vm-nextcloud systemd[1]: Unit nextcloud-fulltext-elasticsearch-worker.service entered failed state.
Jun 07 18:00:35 vm-nextcloud systemd[1]: nextcloud-fulltext-elasticsearch-worker.service failed.
This is my /usr/lib/tmpfiles.d/samba.conf:
d /var/run/samba  755 root root
d /run/samba  755 root root
d /var/run/samba 2775 apache apache - -
Not sure if it’s correct!
If I run the following:
sudo -u apache php /var/www/html/nextcloud/occ fulltextsearch:index
the documents get indexed.
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
- Upload documents (pdf, txt) into nextcloud
B. Search does not always work.
I cannot find out if there is a pattern. Sometimes It can’t find a file neither by file name or extension.
- Upload files into nextcloud
- Use Search or Full Text Search
- Search by file name or extension
Nextcloud version (eg, 12.0.2):13.0.2.1
Operating system and version (eg, Ubuntu 17.04): CentOS 7
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.2.6
The output of your Nextcloud log in Admin > Logging:
sizeof(): Parameter must be an array or an object that implements Countable at /var/www/html/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/SearchMappingService.php#216
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => '...',
'passwordsalt' => '...',
'secret' => '...',
'trusted_domains' =>
array (
0 => '192.168.1.100',
),
'datadirectory' => '/var/www/html/nextcloud/data',
'overwrite.cli.url' => 'https://192.168.1.100/nextcloud',
'dbtype' => 'mysql',
'version' => '13.0.2.1',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'oc_admin',
'dbpassword' => '...',
'installed' => true,
'maintenance' => false,
);
[UPDATE]
It must be related with the app.
If I run in the terminal:
$ curl -XGET 'localhost:9200/nextcloud/_search?q=iso&pretty'
I get more results than in the GUI (local & external files).
For new files files I have to run every time:
$ sudo -u apache php /var/www/html/nextcloud/occ fulltextsearch:index
to get them indexed.