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

**URL:** <https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264>\
**Category:** ℹ️ Support\
**Tags:** fulltextsearch-app\
**Created:** [July 9, 2019, 8:28am UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264 "2019-07-09T08:28:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 9, 2019, 8:28am UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/1 "2019-07-09T08:28:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cult](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cult/32/8547_2.png) [@Cult](https://help.nextcloud.com/u/Cult)\
**Post date:** [July 9, 2019, 1:06pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/2 "2019-07-09T13:06:11Z")

</div>

used version of NC and the fulltextsearch app ?

---

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 9, 2019, 1:51pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/3 "2019-07-09T13:51:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Cult](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cult/32/8547_2.png) [@Cult](https://help.nextcloud.com/u/Cult)\
**Post date:** [July 9, 2019, 1:55pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/4 "2019-07-09T13:55:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 9, 2019, 1:59pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/5 "2019-07-09T13:59:39Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Cult](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cult/32/8547_2.png) [@Cult](https://help.nextcloud.com/u/Cult)\
**Post date:** [July 9, 2019, 3:05pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/6 "2019-07-09T15:05:17Z")

</div>

this should do the trick,

> <https://github.com/nextcloud/fulltextsearch/pull/526>

`./occ fulltextsearch:live --service`

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

---

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 9, 2019, 4:24pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/7 "2019-07-09T16:24:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 10, 2019, 1:51pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/8 "2019-07-10T13:51:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Cult](https://help.nextcloud.com/user_avatar/help.nextcloud.com/cult/32/8547_2.png) [@Cult](https://help.nextcloud.com/u/Cult)\
**Post date:** [July 10, 2019, 7:10pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/9 "2019-07-10T19:10:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![it25fg](https://help.nextcloud.com/user_avatar/help.nextcloud.com/it25fg/32/15901_2.png) [@it25fg](https://help.nextcloud.com/u/it25fg)\
**Post date:** [July 11, 2019, 9:24am UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/10 "2019-07-11T09:24:03Z")

</div>

> [@Cult](#):
>
> 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.

> [@Cult](#):
>
> Could you please create an entry on the wiki on how you create a service ?

The wiki already has an entry: [Basic Installation · nextcloud/fulltextsearch Wiki · GitHub](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.

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 10:04am UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/11 "2024-12-04T10:04:07Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 11, 2024, 3:17pm UTC](https://help.nextcloud.com/t/how-do-i-run-occ-fulltextsearch-live-as-a-service/56264/12 "2024-12-11T15:17:43Z")

</div>


