Repository navigation
Conversation
codeCraft-Ritik
left a comment
There was a problem hiding this comment.
Solid solution
Regarding the compatibility query structure:
- Assuming the
classifier=workflowfallback uses aboolquery withfiltercontext (bool.shouldwithminimum_should_match: 1wrapping thetermandmust_not: { exists: "classifier" }), this will be fully cacheable by Elasticsearch and won't introduce scoring overhead on hot search paths. - Preserving strict equality for
classifier=agentensures no false positives for new agentic workloads.
The test cases covering both query generation and startup reconciliation on legacy indices give a lot of confidence. Approved! 🚀
Contributor
Author
|
@v1r3n @nthmost-orkes Can I get some review on this please? This fixes a regression brought in #1268 for ES8 indexing backend |
matteius
pushed a commit
to opensensor/conductor
that referenced
this pull request
Sep 13, 2026
…onductor-oss#1549) (cherry picked from commit 1bda1d6)
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
classifierkeyword mapping to existing ES8 workflow indices during startup.classifierfield as regular workflows when filtering forclassifier=workflow.classifier=agentfiltering strict.Why
The workflow classifier field was added after some Elasticsearch workflow indices had already been created. Those indices use
dynamic: false, so classifier values can appear in_sourcewithout being indexed. The Conductor UI filters workflow searches usingclassifier=workflow, which causes legacy workflow documents with no indexed classifier to disappear from results.Updating the index template only fixes newly created indices. Existing indices need an additive mapping update, while documents created before classifiers existed need a compatibility query that preserves their previous semantic meaning as regular workflows.
Implementation
During ES8 index initialization, Conductor now applies an additive
keywordmapping forclassifierthrough the workflow alias. ES8 structured queries for the workflow classifier match either an explicitworkflowvalue or documents where the classifier field is absent. Agent classifier queries and all non-ES8 persistence implementations are unchanged.For a direct upgrade from a pre-classifier release, mapping reconciliation runs before new writes, so legacy documents remain visible without a bulk backfill and subsequent classifier values are indexed correctly.
Upgrade caveat
Elasticsearch does not retroactively index values that were already written to
_sourcewhile the field was unmapped. A deployment that previously ran a classifier-enabled Conductor build against an older unmapped workflow index may therefore have explicit classifier values stored only in_source. Those documents require reindexing to recover strict classifier semantics; until then Elasticsearch cannot distinguish an unindexed explicit classifier from a genuinely legacy document with no classifier. This change prevents that state for direct upgrades but cannot reconstruct information Elasticsearch never indexed.When automatic ES8 index management is disabled, operators remain responsible for applying the mapping before classifier-enabled writes, consistent with the existing external index-management contract.
Testing