Skip to content

Restore url as AI enrichment match field#3623

Merged
Mpdreamz merged 1 commit into
mainfrom
fix/enrich-path
Jul 7, 2026
Merged

Restore url as AI enrichment match field#3623
Mpdreamz merged 1 commit into
mainfrom
fix/enrich-path

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Jul 7, 2026

Copy link
Copy Markdown
Member

Why

#3617 renamed the search document identifier url -> path, and along with it 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 when it already exists. As a result, essc contentstack sync (and the docs-builder Elasticsearch exporter) fails during AI-enrichment bootstrap with:

Failed to create enrich policy '...-ai-cache-ai-policy-...': HTTP 500 —
Could not traverse mapping to field [path]. Could not find the [path] field under [root]

What

Reintroduces url as a concrete field mirroring path on SearchDocumentBase (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 legacy url alias, and reverts MatchField back 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 build succeeds across the affected project and the full solution
  • dotnet test tests/Elastic.SiteSearch.Tests — 171/171 passed
  • dotnet format --verify-no-changes clean
  • End-to-end essc contentstack sync against a dev cluster with existing url-keyed AI caches, confirming the enrich policy is reused (not recreated) and enrichment completes

Co-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com

#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>
@Mpdreamz Mpdreamz added the bug label Jul 7, 2026
@Mpdreamz Mpdreamz requested a review from a team as a code owner July 7, 2026 19:23
@Mpdreamz Mpdreamz requested a review from cotti July 7, 2026 19:23
@Mpdreamz Mpdreamz added the bug label Jul 7, 2026
@Mpdreamz Mpdreamz merged commit 0cf1189 into main Jul 7, 2026
25 of 26 checks passed
@Mpdreamz Mpdreamz deleted the fix/enrich-path branch July 7, 2026 19:30
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.

1 participant