Skip to content

Conversation

Myracle
Copy link

@Myracle Myracle commented Sep 17, 2025

This commit introduces a new feature that allows for dynamic index generation in the Elasticsearch connector. The index name can now be constructed by appending a suffix derived from a specified field's value to a prefix.

Key changes include:

  • New Configuration Options:

    • index.suffix.field.name: Specifies the field whose value will be used as the suffix for the index name.
    • index.suffix.field.length: (Optional) Defines the length of the suffix to be extracted from the field's value.
  • Updated Index Generation:

    • The IndexGeneratorFactory has been enhanced to create a SuffixIndexGenerator when the index.suffix.field.name option is configured. This new generator handles the logic of constructing the index name with the specified prefix and the value-derived suffix.
  • Comprehensive Testing:

    • Unit tests have been added to IndexGeneratorTest to validate the new suffix-based index generation functionality, covering various scenarios including length limitation and compatibility with existing index generation methods.

This feature provides greater flexibility in organizing data within Elasticsearch, enabling users to partition their data into different indices based on the values of a specific field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant