Will Elastic Search update index automatically?


#1

Hi All

Will a correct and working configuration of ElasticSearch fulltext search autmatically update the index as files are added? Or is there something we have to cron?

sudo -u apache php /var/www/html/nextcloud/occ fulltextsearch:index
worked correctly in creating an index of all the files that are currently in the instance, but what about newly added files?

Regards

Hans


Elasticsearc cronjob?
#2

After the files were indexed for the first time, you don’t need a cron job for updating the index as this is done in the context of NC’s cron job. Means that you have to wait for the next cron job is scheduled before you can find new/changed documents with the full text search.

If in doubt, you can try it by adding a new document and wait for the cron jonb to run. After that, you should be able to find the newly added document in the full test search.

On NC 14 there will be a “live” feature and I assume that this will trigger an update as soon as new/changed files were detected.


#3

@DecaTec thank you for the explanation. I will have a look at NC 14’s behaviour. Something worth asking for any other newcomers here, one should probably run the initial index manually, before adding the nextcloud cronjob if your instance is very big. That way you will not spawn multiple indexing processes? Or is this illogical of me to wonder about? :neutral_face:


#4

Well, usually one of the first things to do on a new NC instance is configuring the cron job for every 15 minutes. In most cases, the full text search will be installed afterwards.
From my own experience: Cron runs every 15 min and the initial indexing took over an hour on my instance.

As long as there are no errors shown while first indexing, everything should be fine.


#5

Thank you so much. We have 10+ million files in production. I think our index will take a wee bit longer. But this is good info for any newcomers. Thanks again @DecaTec


CE Next Cloud for Small Legal Office
#6

More than 10m files?! That’s pretty much. I just took another look at my NC: ~1h indexing for ~1500 files (mostly on external storage).
I would be interested to know how long initial indexing takes on your instance.


#7

Funny you should say that, everyone seems to be interested in it :smile: Will bookmark this thread and report back if it finishes. (Note the if, not when :wink: )


#8

Hi,

I don’t know if my setting is correct or not but I need to add a cron job in system level. I am using nextcloud docker container.

And yes, if cron job is up and running, indexing is automatic.

Alex


#9

It looks like it failed?


#10

Nope, haven’t done it yet on Production system. Waiting for downtime in December to kick it off.