chore: composable index template default + document DECIMAL mapping (#36) - #58
Merged
Merged
Conversation
…pping Flip use_legacy_template default from true to false so new users get the modern composable _index_template API (ES >= 7.8). #57 is still unreleased, so no shipped version is affected by the default change. The "skipped on ES < 7.8" warning now hints at setting 'use_legacy_template true'. Also document (#36) that DECIMAL columns are sent to Elasticsearch as strings -- BigDecimal cannot cross Fluentd's msgpack buffer, so it is stringified, which also preserves exact precision -- and should be mapped as double or scaled_float in a template, where Elasticsearch's coerce converts the numeric string to a number at index time. No value conversion is needed in the plugin. Update the README examples to the composable template format and the unit tests to the new default. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Two small, related follow-ups to the index-template feature (#57, still unreleased):
1. Default
use_legacy_templatetofalse(composable)New users starting today should get the modern composable
_index_templateAPI (ES ≥ 7.8) rather than the deprecated legacy
_template. Since #57 is notyet released, no shipped version is affected by the default change.
use_legacy_template false(default) →PUT /_index_template(ES ≥ 7.8)use_legacy_template true→PUT /_template(legacy, ES 6.x+)The "skipped on ES < 7.8" warning now tells the user to set
use_legacy_template truefor older Elasticsearch. (Param names still mirrorfluent-plugin-elasticsearch; only the default differs.)
2. Document DECIMAL → numeric mapping (#36)
Answers "why is decimal sent as text?": not a type-inference issue — it's
that
BigDecimalcan't cross Fluentd's msgpack buffer (the original #3 fix), soit is stringified (which also preserves exact precision). The README now explains
that to index decimals as numbers you map the field as
double/scaled_floatina template, and Elasticsearch's
coerceconverts the numeric string at indextime — so no value conversion (and no precision loss) is needed in the plugin.
This resolves the remaining half of #36 (the
geo_pointhalf was handled by #57).Tests
Reworked the template unit tests for the new default (composable install by
default; legacy install when explicitly enabled; skip on ES < 7.8; skip when the
template exists).
24 tests, 0 failureslocally on Ruby 3.4.Follow-up
geo_pointanddecimalare now addressed via index templates).🤖 Generated with Claude Code