OpenCloud · Search
High-performance file search with Bleve and OpenSearch
OpenCloud ships Bleve as a built-in search index and supports OpenSearch for large installations. Up to 7.x, the two often returned different results for the same query. Since 8.0.0, every search query runs against both engines in more than 300 test cases, over 50 bugs are fixed, and a public report in the code shows what search can do. On top of that, a fix cuts Bleve's memory use from 1.2 GB to 133 MB when deleting or moving a folder with 100,000 files.
A small organization starts OpenCloud with what comes along without extra services: Bleve, a search index that runs in the same process as everything else. When the installation grows, OpenSearch joins as a separate service with clustering and replication. The switch is meant to change operations and scaling, not what people find. If report found the file Report.txt yesterday, it should find it tomorrow too.
Up to 7.x, that wasn't the case. Both engines translate the KQL query language into their own queries, and those translations had drifted apart over time. Depending on the engine, results were missing or you got an error.
Different results per engine
The pull request that aligns the two engines in 8.0.0 opens with a table. An excerpt:
| Query | Bleve before | OpenSearch before | both since 8.0.0 |
|---|---|---|---|
report | nothing | nothing | Report.txt |
new | nothing | new-folder | new-folder |
name:"*übung*" | Übung.txt | nothing | Übung.txt |
title:quarterly | nothing | nothing | q1.html |
path:"./parent" | only parent | parent, child.pdf | parent, child.pdf |
type:file | nothing | error 400 | every file |
size>100 | nothing | nothing | filtered by size |
It looked similar for upper and lower case in field names and values (type:File, hidden:TRUE), for ? as a wildcard, for a trailing slash in paths and for negated groups in Bleve. The release notes count more than 50 fixed search bugs for 8.0.0, some of them reported by customers.
Three areas stand out. Path search, meaning everything below a folder, returns the folder and its contents in both engines. Paths are case-sensitive in both engines alike: ./Documents, ./documents and ./DOCUMENTS are three different folders, and deleting or moving Documents also takes its contents with it in the index.
The third area is Chinese. In August, a user reported that OpenSearch on 7.4.0 didn't find Chinese terms, while English ones worked. Chinese has no spaces between words, so OpenSearch splits the text into single characters, and the queries generated from KQL didn't match that. Since 8.0.0, both engines find 报告.txt by name and by terms in its content. The developers name one limitation themselves: in content, a wildcard next to a single character works, so Content:销* finds something, but Content:*销售* with two characters does not.
Parity tests for Bleve and OpenSearch
To keep the engines from drifting apart again, 8.0.0 adds a parity test suite. A test case describes sample files, a KQL query and the expected result, without naming an engine. The suite runs each case against Bleve and against a real OpenSearch instance in a container and compares the answers. It covers names, extensions, tags, titles, content, Chinese text, paths, sizes and date ranges, as well as workflows like deleting, restoring, moving and permanently removing. There are more than 300 cases. They replace more than 90 percent of the tests previously maintained twice, once per engine, and around 200 cases are new.
If an engine deliberately deviates, the test case has to say so. If the deviation stops, the test fails until someone removes the note. Every behavior change thus shows up in the diff as a removed exception. When the suite first ran against the code base at the time, it listed 73 known deviations. The report for 8.0.0 lists none.
The report is a Markdown file in the search package, services/search/pkg/parity/README.md, which the suite writes itself. If it is out of date, the suite fails. For each case it lists the query, the expected result and what Bleve and OpenSearch returned. If you want to know whether name:"Rep*rt.txt" or path:"./parent/" finds anything, you can look it up there instead of trying it. That makes the report double as documentation of the search.

The parity report in tag v8.0.0 as GitHub displays it: query, expectation and both engines’ answers for each test case.
Less memory for Bleve
In early September, a user going by n-at-han-k found the likely cause of crashes on his 7.5.0 installation that others had been seeing for a while, among other things after emptying a large trash bin. The kernel had killed the process 112 times in one day for running out of memory. Memory profiling with pprof showed that an ordinary folder deletion held 2.24 of 2.29 GB of memory in a single query.
When a folder is deleted, moved, restored or permanently removed, the search service looks up all entries below it. Bleve stored the path as a single keyword and had to resolve a wildcard query for it, with a separate search object per file in the folder, all in memory at the same time. The same query sat behind search within a folder and behind path:. n-at-han-k sent a pull request with a limit and a benchmark. Dominik Schmidt picked up the analysis and fixed the root cause. Since 8.0.0, Bleve splits every path into its parent folders, ./a/b.txt into ., ./a and ./a/b.txt, as OpenSearch already did with path_hierarchy. A single query is then enough. Measured by peak memory when looking up 100,000 files in one folder, usage dropped from 1,217 MB to 133 MB. n-at-han-k tested the change on his installation.
Since 8.1.0, deleting, moving, restoring and permanently removing also process the folder in chunks of 20,000 entries instead of collecting them all at once. For 100,000 files, that brings the peak down further to 19 MB.
This matters because an out-of-memory crash in Bleve takes down the whole process. In the Docker installation, NATS runs in the same container, and an interrupted write can corrupt data there.
Reindex when updating to 8.0.0
The fixes change how files are stored in the index. 8.0.0 therefore creates a new, versioned index; for Bleve, that's bleve-v5 next to the old bleve directory. The old one stays untouched until you remove it. The new one starts empty: new changes land in it right away, existing files only after a rebuild:
docker compose exec opencloud opencloud search index --all-spaces --force-rescan --insecure
The service keeps running in the meantime. On startup, the search service now also compares the schema of the existing index with the one in the code. It adds new fields, and it rejects an incompatible change without a new index version instead of returning wrong results from a mismatched index.
For installations using the OpenCloud Helm chart, the chart handles the transition: before the update, a hook checks whether the mapping in the OpenSearch index changes and creates the new index; after the update, a second hook triggers the rebuild for all spaces. While an actual rebuild is running, the instance is currently unavailable. According to the release notes, avoiding that requires changes in OpenCloud itself.
What was added to search after 8.1.0, namely tags in search and bounded memory when rebuilding large indexes, is covered in a separate post.
Sources
- Release v8.0.0, GitHub, 2026-09-15
- Release v8.1.0, GitHub, 2026-10-05
- fix(search): make openSearch and bleve behave the same, GitHub, 2026-08-31
- test(search): engine parity suite for bleve and opensearch, GitHub, 2026-08-31
- test(search): fail the parity suite when the committed matrix is stale, GitHub, 2026-09-01
- test(search): cover chinese search in the parity suite, GitHub, 2026-09-01
- OpenSearch does not support Chinese search, GitHub, 2026-08-18
- feat(search): check the index schema on startup and refuse breaking changes, GitHub, 2026-09-01
- fix(search): bound memory of the bleve descendant lookup, GitHub, 2026-09-08
- fix(search): hierarchy tokenizer for bleve path fields, GitHub, 2026-09-11
- refactor(search): stream bleve descendants, GitHub, 2026-09-25
- OpenCloud process grows to ~6 GB anonymous RSS, GitHub, 2026-09-06
- Engine parity (report, as of v8.0.0), GitHub, 2026-12-04
- Upgrading to OpenCloud 8.x.x, OpenCloud Docs, 2026-12-04