#54: Simplify index template to match production#55
Conversation
Removes 6 problematic dynamic_templates that caused mapper_parsing_exception errors when indexing documents with scalar values at object-mapped paths: - run_objects (results.runs.*) - timeseries_objects (results.runs.*.timeseries.*) - numa_nodes (system_under_test.hardware.numa.*) - storage_devices (system_under_test.hardware.storage.*) - network_interfaces (system_under_test.hardware.network.*) - cpu_flags (system_under_test.hardware.cpu.flags.*) - validation_threads (results.runs.*.validation.threads) Adds strings_as_keyword dynamic_template to match production behavior: - Maps all string fields as keyword type - Sets ignore_above: 1024 to prevent indexing overly long strings Template now matches production with only 2 dynamic_templates: 1. test_config_parameters_as_keyword 2. strings_as_keyword Settings verified: - dynamic: true (allows flexible schema) - storage.enabled: false (prevents mapping conflicts) - total_fields.limit: 5000 (matches production) Part of #54
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe OpenSearch index template is updated to match production configuration: the top-level ChangesIndex Template Mapping Corrections
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
grdumas
left a comment
There was a problem hiding this comment.
PR Review: #54: Simplify index template to match production
Summary
The PR simplifies the OpenSearch index template by removing complex and problematic dynamic templates, switching to dynamic: true, and aligning the configuration with the production environment. This directly addresses mapper_parsing_exception errors caused by mapping conflicts.
Critical Issues (MUST FIX)
None found.
Security Delta
No security-relevant code was removed. The addition of total_fields.limit: 5000 is a positive security/stability measure to prevent mapping explosion in a dynamic mapping environment.
Major Issues (SHOULD FIX)
None found.
Minor Issues (NICE TO HAVE)
-
Field: results.runs.validation.threads
The removal of thenestedmapping forvalidation_threadsmeans that cross-field correlation queries within the same thread object in the array will no longer work as expected. However, as this aligns with production and fixes parsing exceptions, it is likely the correct trade-off. -
Field: system_under_test.hardware.storage
Changing this field to"enabled": falsemeans that data within the storage object will be stored but not indexed. Users will be able to retrieve this data in the_sourcedocument but will not be able to search or aggregate on its internal fields. If searching on storage devices is required, this may need to be revisited.
Nitpicks (OPTIONAL)
None.
Positive Notes
- Good use of
strings_as_keywordwithignore_above: 1024to ensure consistent mapping of string fields while protecting against overly long values. - Aligning local development templates with production is excellent practice to avoid "works on my machine" issues.
- The PR description is very detailed, clearly explaining the "Before" vs "After" and the rationale for the removals.
Overall Assessment
- Status: APPROVE
- Reasoning: The changes are well-justified, follow production standards, and solve a known issue with indexing failures.
- Next Steps: Merge the PR and verify the fix with local OpenSearch as planned in the manual testing section.
Reviewed by: Gemini Pro via automated code review
PR Update: Review ResponseWhat was doneNo code changes were made. The review is approved and the noted trade-offs are intentional per the production specification. Addressing the minor notes1. validation_threads nested mapping removal The removal of the
Per issue #54, production has only 2 dynamic_templates with 2. storage field indexing disabled Setting
This prevents mapping conflicts while preserving data in Why this approachBoth noted items are not issues to fix but rather intentional design decisions documented in #54 that prioritize:
Next StepsPR is ready for manual testing per the acceptance criteria:
Responded by: Claude Sonnet 4.5 via automated workflow |
Summary
Simplifies OpenSearch index template to match production configuration by removing 6 problematic dynamic_templates that caused mapper_parsing_exception errors when indexing documents with scalar values at object-mapped paths.
Problem
The local template defined 11 dynamic_templates with explicit object mappings that conflicted with actual data structures. Production uses only 2 dynamic_templates with a flexible schema approach.
Changes
Removed 7 problematic dynamic_templates:
Added strings_as_keyword dynamic_template:
Template now has only 2 dynamic_templates (matches production):
Verified settings match production:
Static mappings preserved:
Acceptance Criteria
Testing
Code validation completed:
Manual testing required:
The remaining acceptance criteria require manual verification with a running OpenSearch instance and sample benchmark data. The code changes are complete and match the production specification described in the issue.
Impact
Before: Documents failed indexing with mapper_parsing_exception due to object/scalar type conflicts
After: Template matches production, allowing flexible schema with proper string handling
Related
Files Modified
Generated with Claude Code (Claude Sonnet 4.5)