Files
opencloud/services/search/MIGRATION.md
T
Florian Schade bd4287762e fix(search): answer the same on both engines
both engines now agree on names, titles, tags, paths, types, sizes, dates,
hidden flags, facet values and wildcards. quotes only delimit phrases and
the equals operator matches the whole field value, following the kql spec.
the index name carries a generation so a changed mapping starts on a fresh
index, MIGRATION.md says how to fill it.
2026-08-31 10:44:03 +02:00

1.7 KiB

Migrating the search index

A version that changes how resources are indexed works on a new index and leaves the old one untouched. The service starts normally, but the new index is empty: search finds nothing until it is filled. The old index stays around until you remove it.

v7.x.x to %%NEXT%%

OpenSearch

The new index is opencloud-resource-v3. Fill it in one of two ways:

  • copy the old index, fast and keeps the extracted file contents, or
  • index all spaces again, slower since every file is read once more, but drops documents that no longer have a resource.

The address below is the one from SEARCH_ENGINE_OPEN_SEARCH_CLIENT_ADDRESSES, opencloud-resource the name from SEARCH_ENGINE_OPEN_SEARCH_RESOURCE_INDEX_NAME.

# either copy the old index
curl -X POST "https://opensearch.example.com:9200/_reindex?wait_for_completion=false" \
  -H 'Content-Type: application/json' -d '
  {"source":{"index":"opencloud-resource"},"dest":{"index":"opencloud-resource-v3"}}'

# the answer carries a task id, watch it while it runs
curl "https://opensearch.example.com:9200/_tasks/<task-id>"

# or index all spaces again, the service keeps running while it happens
opencloud search index --all-spaces

Once the new index is filled, remove the old one:

curl -X DELETE "https://opensearch.example.com:9200/opencloud-resource"

bleve

The new index is the bleve-v2 directory next to the old bleve one, both in $OC_BASE_DATA_PATH/search by default (SEARCH_ENGINE_BLEVE_DATA_PATH). A bleve index cannot be copied, index all spaces again:

opencloud search index --all-spaces

Once the new index is filled, remove the old one:

rm -r "$OC_BASE_DATA_PATH/search/bleve"