How to implement Elasticsearch in Nextcloud

I tried it again (a couple of hours later) and it’s running now. So either it completed the index in the background, or the process just took a while to die.

This worked great thank you guys for all the help I have another issue logged in as admin Nextcloud with the external storage enabled I cant add I get a screen that says “No external storage configured or you don’t have the permission to configure them” Anybody experienced this or know how to fix.

I tried to setup an SMB share now and it worked, are you logged in as Nextcloud admin and clicking on “External Storage” under “Administration”?

Yes I’m logged in as admin and below is a screenshot that I receive when I click on external storage

You clicked on “External Storage” under “Personal” but you may have to click on it under “Administration”:

Did you configure some external storage from the other “External Storages” link menu towards the bottom of the screen?

1 Like

Ok I see my bad sorry clicking on the thing thanks again is their any information anywhere that shows the proper configuration using a samba share thats set up on Nethserver?

Should be straightforward:

Tesseract OCR would seem like a nice thing to have as well–any ideas on adding that?

I have Elasticsearch working in Nextcloud appears to be finding results however the results are not listed in the view panel has shown here.

Does it work with local files ticked? Did you try another browser?

I uploaded some local files into a test folder I created in nextcloud and reindexed and it worked however it will lot work when i add ext SFT Storage share

Did you enable external files in the Nextcloud Full text search settings?

I don’t have an SFT share to test but it’s working with an SMB share.

got it working using smb share…I’m getting PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 26039464 bytes) in /usr/share/nextcloud/apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php on line 573

does the command: sudo -u apache /opt/rh/rh-php71/root/usr/bin/php -d memory_limit=512M /usr/share/nextcloud/occ files:scan -v username" actually index the files or just scan them?

It just scans the files.

For indexing:

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

Interested too in this…

This did it for me, works like a charm:

yum install tesseract

Then pick you choice out of the many languages to be recognized and install them (English is installed by default): “yum search all tesseract”

and install the requered language(s) e.g. yum install tesseract-langpack-fra

Install the full text search OCR app in nextcloud, go to settings → search and set your installed languages (watch the language abbreviation e.g. eng,fra,deu) and enable OCR.

Just not sure the interval when elasticsearch re-indexes, maybe this is related to the cronjob?

Here is a test image to upload and test https://courses.cs.vt.edu/csonline/AI/Lessons/VisualProcessing/OCRscans_files/bowers.jpg

2 Likes

Just as a tip, the RedHat way syntax would be:

sudo -u apache scl enable php71 ‘php -d memory_limit=512M /usr/share/nextcloud/occ fulltextsearch:index’

scl enable php71 ensures that all php71 related environment variables are being used.

1 Like

Strangely, the yum search all comes up with many language packs, but none mention English. Even did a grep in case I was inadvertently looking past it. ?? OK, there is -enm for Middle English, but I’m not going to be working with Chaucer.

My bad example.

“THE ENGLISH LANGUAGE, DATAFILES ARE SUPPLIED IN THE STANDARD PACKAGE.”

Adjusted my post above. Sorry