Skip to content

Commit fc7c5cc

Browse files
reakaleekclaude
andcommitted
Search: Fix ingest timestamp access in content-date pipeline
Replace ctx._ingest.timestamp (not available in Painless script processors) with a set processor using Mustache {{{_ingest.timestamp}}}. The set processor pre-sets content_last_updated to the ingest timestamp, and the script processor only overwrites it when the enrich lookup finds a matching content hash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3899203 commit fc7c5cc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Elastic.Markdown/Exporters/Elasticsearch/ContentDateEnrichment.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ private async Task PutPipelineAsync(Cancel ct)
141141
{
142142
["description"] = "Resolves content_last_updated via enrich policy lookup on content_hash",
143143
["processors"] = new JsonArray(
144+
new JsonObject
145+
{
146+
["set"] = new JsonObject
147+
{
148+
["field"] = "content_last_updated",
149+
["value"] = "{{{_ingest.timestamp}}}"
150+
}
151+
},
144152
new JsonObject
145153
{
146154
["enrich"] = new JsonObject
@@ -161,8 +169,6 @@ private async Task PutPipelineAsync(Cancel ct)
161169
def lookup = ctx._content_date_lookup;
162170
if (lookup != null && lookup.content_hash != null && lookup.content_hash == ctx.content_hash) {
163171
ctx.content_last_updated = lookup.content_last_updated;
164-
} else {
165-
ctx.content_last_updated = ctx._ingest.timestamp;
166172
}
167173
ctx.remove('_content_date_lookup');
168174
"""

0 commit comments

Comments
 (0)