Files
AFFiNE-Mirror/packages/backend/server/e2e/remote-provider
DarkSky b530198a3b feat(server): improve indexer perf (#15512)
#### PR Dependency Tree


* **PR #15512** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Search now supports generation-based indexing with embedded and remote
providers.
* Added automatic search reconciliation and improved handling of
document, workspace, and permission changes.
* Added clearer search status errors for unavailable, syncing, unready,
or failed indexes.
* Added Manticore Search end-to-end support and provider-specific search
behavior.

* **Improvements**
* Search and aggregate pagination now report returned results and
continuation status more accurately.
* Improved permission filtering to prevent inaccessible documents from
appearing in results.
  * Admin provider selection now consistently enables indexing.

* **Documentation**
* Clarified search pagination, aggregation counts, provider
configuration, and end-to-end setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-23 17:54:49 +08:00
..

Remote provider E2E

These tests exercise the Elasticsearch-compatible provider over HTTP against a local OpenSearch instance. Toxiproxy is included so the lease test can inject provider latency without changing production code.

docker compose -f packages/backend/server/e2e/remote-provider/compose.yml up -d --wait

DATABASE_URL=postgresql://ds:ds@localhost:55432/affine_rfc6_remote_e2e \
yarn workspace @affine/server prisma migrate deploy

Configure packages/backend/server/config.json with:

{
  "indexer": {
    "enabled": true,
    "provider": {
      "type": "elasticsearch",
      "endpoint": "http://127.0.0.1:8666"
    }
  }
}

Then run:

DATABASE_URL=postgresql://ds:ds@localhost:55432/affine_rfc6_remote_e2e \
yarn af server e2e src/__tests__/e2e/indexer/remote-provider.spec.ts

docker compose -f packages/backend/server/e2e/remote-provider/compose.yml down -v

The suite uses a disposable PostgreSQL database and creates generation-specific indices. It directly deletes or mutates provider rows only as a fault-injection fixture; production code still repairs them through the normal reconcile path.