How to implement Elasticsearch in Nextcloud

It’s working here but I needed to enable untested app “Full text search - Elasticsearch Platform”.

Does the indexing work without error?

sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ fulltextsearch:index

Is elasticsearch running?

systemctl status elasticsearch

@mrmarkuz

Hi Markus

I only have this as untested:

And, yes, elasticsearch runs and starts without issues.

Running a manual Index works, but at the end I see this:

And searching for any files only gives results when the searched value is part of a filename or directory. no contents - even simple textfiles are indexed… :frowning:

I can confirm that even PDF indexing was working before 7.9.2009…
Not exactly sure when it broke… :frowning:

You may try to reset the fulltextsearch and index again afterwards:

sudo -u apache /opt/rh/rh-php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ fulltextsearch:reset

Here are my Nextcloud fulltext search settings:

PDF and txt content search is working here with 7.9.2009.

EDIT:

You may also check if elasticsearch answers correctly (I have version 7.9.1)

curl -X GET localhost:9200

and the nextcloud logs in /var/lib/nethserver/nextcloud/nextcloud.log

1 Like

OK, resetted Elasticsearch…

My settings are exactly the same as yours, with the exception of Tesserect, which I also have installed (And also was working…)

curl -X GET localhost:9200 always showed a correct responce…

OK, will now start a new index, this will take a long time…

Will give some feedback ASAP.

You don’t use Tesserect OCR in your setup?

Update:
Index now running, i finally again see Tesserect running, seems like the reset helped!
But the index will take time…

I think it was disabled on this server, I don’t use the full text search feature much…

Great that it seems to work now.

For me, my Macbook will find files just as fast… (As you, i don’t use it much)

But some of my clients, with their really fast search options in Windows 10, really WANT Fulltextsearch! :slight_smile:

When working, Tesseract OCR actually does a good job. I have 4 languages installed.

1 Like

I can confirm that after resetting the index my elastic search instance works without errors . I did this immediately after the 7.9 update. Since then, the smart search works without problems.

2 Likes

Hello,
does anyone know how to exclude certain file types from the search based on their extension?

Sincerely, Marko

@Andy_Wismer @mrmarkuz
I reseted my Index because errors like here. Then I re-indexed and can monitor the indexing of each newly added file, by

sudo -u apache /opt/remi/php73/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ fulltextsearch:live

But within Nextcloud I don’t get any result when I search any string.
What could have happened there?


If I test the index, all works fine.
GET http://127.0.0.1:9200/_search?q=Dfvekvbewvervbtwt

…shows me a the relevant file with the content.

But not in Nextcloud!
Sincerely, Marko

@capote

Hi

At the moment all my Nextclouds do NOT have working FullTextSearch, even though Elasticsearch as such seems to work OK… :frowning:

No idea what is not working…

My 2 cents
Andy

1 Like

this is a miracle … While investigating this problem over 3 hours … nothing works.
After I finished this article … it now works in Nextcloud.

I love this community more and more . … The problems solve themselves after you post them here.

After you have posted it here, it should work now :rofl:

Not quite - still seeing stuff like this…

may be related to group folders?

I’m not using Group Folders at home…

Is there something in /var/log/elasticsearch/elasticsearch.log ?

Which elasticsearch version do you use?

[root@nethserver ~]# rpm -qa elasticsearch
elasticsearch-7.11.1-1.x86_64

Maybe an update helps.

You may try to reset fulltextsearch

sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ fulltextsearch:reset

and create a new index and check if there are errors:

sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ fulltextsearch:index

1 Like