Skip to content

Fix linearize_dict to handle optional parent objects in highlights#19

Merged
rr0gi merged 2 commits intomasterfrom
louis/fix-highlight-optional-parent
Mar 27, 2026
Merged

Fix linearize_dict to handle optional parent objects in highlights#19
rr0gi merged 2 commits intomasterfrom
louis/fix-highlight-optional-parent

Conversation

@Khady
Copy link
Copy Markdown
Contributor

@Khady Khady commented Mar 27, 2026

When a parent field in the ES mapping is marked as optional, highlight field derivation would generate a nested type instead of the correct flat structure. ES highlights always use flat dotted keys regardless of parent optionality, so linearize_dict should recurse through Maybe(Dict) the same way it recurses through Dict.

@Khady Khady force-pushed the louis/fix-highlight-optional-parent branch from 63ef9aa to ec839f8 Compare March 27, 2026 07:38
Khady added 2 commits March 27, 2026 07:53
Capture the old highlight derivation behavior with one optional parent object and one non-optional sibling object. The buggy output collapses the optional path to ~content while the non-optional path still flattens to ~summary_text.

Leave test/highlight_optional_parent/query.ml out of git because generated query files are ignored.
Highlight fields should stay flattened even when a parent object is optional. Elasticsearch returns flat dotted highlight keys regardless of parent optionality.

Update the regression output so both the optional content path and the non-optional summary path flatten to leaf highlight fields.
@Khady Khady force-pushed the louis/fix-highlight-optional-parent branch from 8b96954 to fc1eb53 Compare March 27, 2026 07:55
@rr0gi rr0gi merged commit 6667c8a into master Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants