Skip to content

#2168 - proposal replace meilisearch elasticsearch with seal#2408

Open
MrHDOLEK wants to merge 45 commits into
flow-php:1.xfrom
MrHDOLEK:2168-proposal-replace-meilisearch-elasticsearch-with-seal
Open

#2168 - proposal replace meilisearch elasticsearch with seal#2408
MrHDOLEK wants to merge 45 commits into
flow-php:1.xfrom
MrHDOLEK:2168-proposal-replace-meilisearch-elasticsearch-with-seal

Conversation

@MrHDOLEK

@MrHDOLEK MrHDOLEK commented May 31, 2026

Copy link
Copy Markdown
Contributor

The Elasticsearch and Meilisearch adapters are replaced by a single SEAL adapter
(flow-php/etl-adapter-seal) built on top of SEAL
— a PHP Search Engine Abstraction Layer. One adapter now covers Elasticsearch, OpenSearch,
Meilisearch, Algolia, Solr, Typesense, RediSearch and Loupe: the user builds a
CmsIg\Seal\EngineInterface and passes it to the DSL, exactly like the PostgreSQL/Doctrine
adapters take a client. Tests are backend-agnostic (Memory adapter) and prove every Flow
Entry type survives a round-trip through the adapter.

Resolves: #2168

Change Log


Added

  • SEAL adapter (flow-php/etl-adapter-seal) — a single, strongly typed integration for SEAL search engines (Elasticsearch, OpenSearch, Meilisearch, Algolia, Solr, Typesense, RediSearch, Loupe)
  • from_seal() extractor and to_seal() loader, working with any SEAL EngineInterface
  • to_seal_schema() and seal_schema_to_flow() DSL — recursive, bi-directional Flow Schema ↔ SEAL Schema conversion (nested structures, lists and maps)
  • seal_create_index(), seal_drop_index(), seal_create_schema() and seal_drop_schema() DSL index-lifecycle helpers

Fixed

Changed

Removed

  • Elasticsearch adapter (flow-php/etl-adapter-elasticsearch) — superseded by the SEAL adapter; use SEAL with the Elasticsearch backend (cmsig/seal-elasticsearch-adapter)

Deprecated

Security

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.79279% with 72 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.10%. Comparing base (6bfba82) to head (0cd33ec).
⚠️ Report is 48 commits behind head on 1.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x    #2408      +/-   ##
============================================
+ Coverage     84.94%   85.10%   +0.15%     
- Complexity    20648    21181     +533     
============================================
  Files          1570     1597      +27     
  Lines         63532    65358    +1826     
============================================
+ Hits          53968    55623    +1655     
- Misses         9564     9735     +171     
Components Coverage Δ
etl 88.32% <ø> (-1.03%) ⬇️
cli 89.40% <ø> (ø)
lib-array-dot 81.44% <ø> (ø)
lib-azure-sdk 64.44% <ø> (ø)
lib-doctrine-dbal-bulk 93.61% <ø> (ø)
lib-filesystem 85.03% <ø> (ø)
lib-types 90.06% <ø> (-1.92%) ⬇️
lib-parquet 70.10% <14.28%> (+1.21%) ⬆️
lib-parquet-viewer 82.26% <ø> (ø)
lib-snappy 89.82% <ø> (-0.45%) ⬇️
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.58% <91.11%> (+0.01%) ⬆️
lib-telemetry 85.95% <100.00%> (+1.64%) ⬆️
bridge-filesystem-async-aws 92.74% <ø> (ø)
bridge-filesystem-azure 90.45% <ø> (ø)
bridge-monolog-http 96.82% <ø> (-1.04%) ⬇️
bridge-monolog-telemetry 94.11% <ø> (ø)
bridge-openapi-specification 92.07% <ø> (ø)
symfony-http-foundation 78.57% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr3-telemetry 97.84% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 89.89% <ø> (-0.61%) ⬇️
bridge-symfony-http-foundation-telemetry 89.47% <ø> (ø)
bridge-symfony-filesystem-bundle 90.20% <100.00%> (-1.34%) ⬇️
bridge-symfony-filesystem-cache 98.14% <ø> (ø)
bridge-symfony-postgresql-bundle 93.83% <90.53%> (-0.72%) ⬇️
bridge-symfony-postgresql-cache 94.41% <ø> (ø)
bridge-symfony-postgresql-messenger 98.80% <100.00%> (ø)
bridge-symfony-postgresql-session 93.65% <ø> (ø)
bridge-symfony-telemetry-bundle 80.80% <94.62%> (+4.79%) ⬆️
adapter-chartjs 84.05% <ø> (ø)
adapter-csv 91.16% <ø> (ø)
adapter-doctrine 90.79% <ø> (ø)
adapter-google-sheet 99.18% <ø> (ø)
adapter-http 72.34% <ø> (-0.71%) ⬇️
adapter-json 88.63% <ø> (ø)
adapter-logger 50.00% <ø> (ø)
adapter-parquet 77.70% <ø> (-4.05%) ⬇️
adapter-text 74.13% <ø> (ø)
adapter-xml 83.40% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 94.21% <ø> (ø)
adapter-postgresql 91.11% <95.83%> (+0.21%) ⬆️
adapter-seal 87.16% <87.16%> (∅)
bridge-phpunit-postgresql 75.30% <ø> (ø)
bridge-phpunit-telemetry 80.08% <95.45%> (-0.01%) ⬇️
bridge-phpstan-types 0.00% <ø> (ø)
bridge-postgresql-valinor 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norberttech

Copy link
Copy Markdown
Member

@MrHDOLEK as we discussed offline, please find some feedback and guidance below.

Extractor / Loader

In general I like the idea of having one extractor that accepts Seal EngineInterface which is aligned with how Doctrine Adapter works right now. Same goes for the loaders.

It would also work very well with frameworks as seal provides a bundle for symfony that literally configures engine so to use it with flow it would be a simple matter of dependency injection.

What to test

I had to think about it a bit more but I dont think we should retest every backend that seal is testing. Doctrine adapter is testing MySQL, PostgreSql nad Sqlite because flow-php/docrtine-dbal-bulk which extends doctrine default behaviors that needs to be tested.

At this time seal provides following adapters:

I would chose one of them (that requires the least configuration and is the easiest to setup in docker) and cover it with proper integration tests that would confirm that moving data from flow to seal works as expected.
Heck you can even use MemoryAdapter in tests unless other adapters have some features that requires some custom configuration.
The only thing you might want to research first is are there any differences between seal adapters. Flow needs to be flexible enough to use all of them, so if one requires something custom, flow extractor/loader needs to be able to pass it through (but I dont think thats the case).

How to test

So in general we want to cover in tests that seal adapter can handle all types of flow Entries. You can achieve that by using one of the two extractors:

They both expose static method schema() : Schema but here is where the tricky part starts. I believe you need to be able to first create an index in tests.
And that brings us to a missing piece of this PR - SchemaConverter.

SchemaConverter

Schema converters are recursive algorithms that can convert schema in both directiosn Flow to Seal and Seal to Flow. You can find some inspirations here:

It might be the easiest to use LLM to help you create one based on those 3 examples for Seal (it's a recursive brain damaging exercise that might not be worth spending time on).

Of course schema converters would need a DSL method.

Search Engine in Tests

So in this PR you are using traits to configure backends in tests, which is fine but there is a different pattern which I found cleaner and easier to maintain.

Contexts.

Here is a good example of DatabaseContext that is used in DatabaseTableListCommandTest

If there will be more than one integration tests you can extract an abstract SealTestCase extends FlowTestCase and setup SealContext in the setUp method making it available through sealContext() : SealContext method.

In case of any questions, you know where to find me 😁

@MrHDOLEK MrHDOLEK marked this pull request as ready for review June 9, 2026 21:00
@MrHDOLEK MrHDOLEK requested a review from norberttech as a code owner June 9, 2026 21:00
Comment thread documentation/upgrading.md Outdated
Comment thread phpunit.xml.dist Outdated
Comment thread src/adapter/etl-adapter-seal/.github/workflows/readonly.yaml Outdated
Comment thread src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/SealExtractor.php Outdated
MrHDOLEK and others added 3 commits June 10, 2026 10:50
…flow-php#2439)

split DateTimeConverter into TimestampConverter and
TimestampTzConverter
- normalize TIMESTAMP values to UTC, tag timestamp reads as UTC
- map DateTimeEntry/DateTimeType to timestamp by default

@norberttech norberttech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better! I left some comments, nothing critical, but there is one gap related to Delete operation.

Please let me know if you have any questions about those comments!

Comment thread src/adapter/etl-adapter-seal/tests/Flow/ETL/Adapter/Seal/Tests/SealTestCase.php Outdated
use Flow\ETL\Rows;
use Generator;

final readonly class RowsNormalizer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is missing unit tests but even more important, EntryNormalizer is missing them

Comment thread documentation/components/adapters/seal.md Outdated
Comment thread src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/functions.php Outdated
Comment thread src/adapter/etl-adapter-seal/src/Flow/ETL/Adapter/Seal/SealLoader.php Outdated
Comment thread compose.yml.dist
MYSQL_ROOT_PASSWORD: root
networks:
- flow-php
elasticsearch:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we dont wanna keep at least one real search engine in the repo? I mean I know we should be able to trust seal it works exactly same way but... Maybe keeping elasticsearch wouldnt be a bad idea and use it in integration tests keeping memory adapter for unit tests? (no strong opinion about this one yet, I never used seal so dont know how much in memory implementation is different from actual one)

norberttech and others added 5 commits June 10, 2026 12:32
…ow-php#2438)

Bumps [symfony/polyfill-mbstring](https://github.com/symfony/polyfill-mbstring) from 1.38.1 to 1.38.2.
- [Release notes](https://github.com/symfony/polyfill-mbstring/releases)
- [Commits](symfony/polyfill-mbstring@v1.38.1...v1.38.2)

---
updated-dependencies:
- dependency-name: symfony/polyfill-mbstring
  dependency-version: 1.38.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-version: 2.2.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

enum Operation: string
{
case DELETE = 'delete';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more replace than delete cause data will be available, no?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's actual delete

return;
}

if (count($documents) < $this->pageSize) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of counting, add counter variable and increment it in loop?

{
$engine = new Engine(new MemoryAdapter(), $schema);

foreach (array_keys($schema->indexes) as $index) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
foreach (array_keys($schema->indexes) as $index) {
foreach ($schema->indexes as $index => $value) {

MrHDOLEK and others added 6 commits June 11, 2026 13:21
…utes (flow-php#2441)

- add `resource_attributes` parameter (env, urldecoded key=value pairs)
- merge attributes onto the telemetry resource, overriding defaults
- percent-decode `OTEL_RESOURCE_ATTRIBUTES` keys/values in telemetry
EnvironmentDetector (OTel spec), dropping backslash escaping
…flow-php#2442)

* feat(flow-php/telemetry): expose log severity to the attribute filter

- inject log.severity (number) and log.severity_name into signal
attributes for matching

* fix: remove coverage from test suits other than 8.3
…utdown SIGSEGV (grpc#38216) no longer fails CI (flow-php#2444)

* fix: set experimental env var on grpc to avoid crashes

* fix(flow-php/telemetry-otlp-bridge): isolate grpc tests from PHP 8.5 shutdown segfault

- tag grpc-exercising tests with #[Group('grpc')]
- split CI into main (--exclude-group grpc) and grpc steps
- grpc step continue-on-error on 8.5 only (upstream grpc#38216)
aeon-automation and others added 23 commits June 12, 2026 11:51
…fault comparison (flow-php#2446)

- model defaults as a `ColumnDefault` value object (literal, type, kind)
- compare constant defaults type-aware so a wrong-typed stored cast is
detected
- add `ColumnType::isSameBaseType()` (base type, ignoring typmod)
…ndles (flow-php#2448)

* feature: add Web Profiler integration for telemetry and postgresql bundles

- telemetry data collector with spans, metrics and logs panels
- postgresql data collector recording queries with EXPLAIN support
- RecordingClient/QueryLog to capture executed queries
- CompositeExporter to fan signals out to multiple exporters
- profiler controllers, twig templates and DI wiring

* chore: raise Web Profiler coverage and fix docs wording
Bumps [google/protobuf](https://github.com/protocolbuffers/protobuf-php) from 5.35.0 to 5.35.1.
- [Commits](protocolbuffers/protobuf-php@v5.35.0...v5.35.1)

---
updated-dependencies:
- dependency-name: google/protobuf
  dependency-version: 5.35.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…ogle/protobuf-5.35.1

build(deps): bump google/protobuf from 5.35.0 to 5.35.1
…h-elasticsearch-with-seal' into 2168-proposal-replace-meilisearch-elasticsearch-with-seal

# Conflicts:
#	composer.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal]: Replace Meilisearch & Elasticsearch with SEAL

4 participants