How do I run ```occ fulltextsearch:live``` as a service?

Hello all,

on a busy Nextcloud site, I intend to install occ fulltextsearch:live as a service. My question is not about how to make a service in general – I know.

I’d like to know good commandline options for occ fulltextsearch:live that let me catch its output into a normal log file, without the ESC sequences that make colored output and set screen positions.

used version of NC and the fulltextsearch app ?

Nc 14.0.12, FTS 1.1.3.

But honestly, would this really make a difference? In a test instance with nc 16 and the matching FTS, it’s just the same. I’ve tried the --no-ansi switch: it omits colors but happily continues spitting out ANSI ESC sequences. I’ve tried the --output=plain but it simply does not change anything. Are there some other options?

just to know down to which version I will need to backport my work

Ahh, this means there is very recent work on this? Don’t be too quick with backporting… If you reference the PR then I could try to apply backwards (just as I already did for other trivial changes).

this should do the trick,

./occ fulltextsearch:live --service

Could you please create an entry on the wiki on how you create a service ?

Many thanks! I’ll apply this PR and add some info to the wiki.

Successfully applied patch to a NC 15 and a NC 14. Works like a charm. Basically the patch does a scriptname >/dev/null 2>&1 with the additional benefit that the now-unused output is not even produced.

The downside of this approach is that I don’t get no output at all:

  • Files successfully processed don’t have to produce output -> this is correct.
  • Errors returned from ElasticSearch can be retrieved from the message column of the oc_fulltextsearch_indexes table -> so I can troubleshoot these errors.
  • But the exception that would otherwise terminate occ (lines 271-273) would not get recorded anywhere -> this makes it hard to troubleshoot (or even spot).

Would it be possible to print the exception message to the standard logging channel or to stdout?

Regarding the 2nd point, you can find the issue from indexing when using the ./occ fulltextsearch:index and navigate to the errors. But you’ll need to stop the service.

I updated the PR for your 3rd point.

Wonderful! I patched my instance. Unfortunately, I wouldn’t want to provoke an exception in the productive environment, but I’m confident it will work.

The wiki already has an entry: https://github.com/nextcloud/fulltextsearch/wiki/Basic-Installation#live-index-service I did it exactly the same way. The only change should be to add the --service switch to the ExecStart line when the PR is merged and delivered.

1 Like