Restore url as AI enrichment match field#3623
Merged
Merged
Conversation
#3617 renamed the document identifier url -> path and flipped the AI enrichment MatchField to "path" on all four mapping configs. Live clusters already have AI-cache lookup indices and enrich policies keyed on url, and the enrichment orchestrator never reconciles an existing lookup index's mapping, so enrich policy creation fails with "Could not find the [path] field under [root]". Reintroduce url as a concrete field mirroring path (rather than an alias, which enrich processors can't read at ingest time) and revert MatchField back to "url" on all four configs. The policy name hash is derived only from AI output fields, so this reproduces the exact policy name already present in live clusters, reusing existing caches untouched. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.
Why
#3617 renamed the search document identifier
url->path, and along with it flipped the AI-enrichmentMatchFieldto"path"on all four mapping configs. Live clusters already have AI-cache lookup indices and enrich policies keyed onurl, and the enrichment orchestrator never reconciles an existing lookup index's mapping when it already exists. As a result,essc contentstack sync(and the docs-builder Elasticsearch exporter) fails during AI-enrichment bootstrap with:What
Reintroduces
urlas a concrete field mirroringpathonSearchDocumentBase(rather than an ES alias, which enrich processors can't read at ingest time — they operate on the raw ingest context before aliases materialize), removes the now-conflicting legacyurlalias, and revertsMatchFieldback to"url"on the four[AiEnrichment<T>]configs (Site, Docs, Labs, Guide).The versioned enrich policy name is a hash of the AI output fields only, not the match field, so this reproduces the exact policy name already present in live clusters — existing AI caches are reused untouched, with no reindex or manual policy changes required.
Test plan
dotnet buildsucceeds across the affected project and the full solutiondotnet test tests/Elastic.SiteSearch.Tests— 171/171 passeddotnet format --verify-no-changescleanessc contentstack syncagainst a dev cluster with existingurl-keyed AI caches, confirming the enrich policy is reused (not recreated) and enrichment completesCo-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com