owncloud / owncloud/ocis

search: force re-index command

Open
#9,106 1 comment 0 reactions 0 assignees View on GitHub
Category:Enhancement
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Is your feature request related to a problem? Please describe.

I want to force the search service to rebuild the search index for a space / all spaces.
This can currently only be done by deleting the bleve database because search tries to outsmart me and says:

```
ocis-1 | {"level":"debug","service":"search","path":".","time":"2024-05-08T12:48:54Z","line":"github.com/owncloud/ocis/v2/services/search/pkg/search/service.go:419","message":"Walking tree"}
ocis-1 | {"level":"debug","service":"search","path":".","time":"2024-05-08T12:48:54Z","line":"github.com/owncloud/ocis/v2/services/search/pkg/search/service.go:427","message":"subtree hasn't changed. Skipping."}
ocis-1 | {"level":"debug","service":"search","count":2,"time":"2024-05-08T12:48:54Z","line":"github.com/owncloud/ocis/v2/services/search/pkg/search/search.go:67","message":"new document count"}
```

What it doesn't know: I might have enabled OCR on the Tika side in the meantime.

## Describe the solution you'd like

Introduce a `--force` option, eg. `ocis search index --force`. It would do the reindexing even there were no changes detected.

## Describe alternatives you've considered

Deleting the whole bleve database. But that creates a downtime of the search index until it has been completely rebuilt. The proposed solution could work in place / only have a search "downtime" for the space we're re-indexing.

## Additional context

search service re-index using service account: https://github.com/owncloud/ocis/issues/9103

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.