opensearch-project / opensearch-project/opensearch-java

[FEATURE] Backport changes in PatternReplaceTokenFilter to version 2.x

Open
#1,519 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

Is your feature request related to a problem?

I am running into an issue with the v2.2.0 client while trying to create an index that uses a pattern_replace custom analyzer. The error is within PatternReplaceTokenFilter where it's expected that flags field is required, but it is not actually required per Elasticsearch and Opensearch.

What solution would you like?

I see that in the main branch, this code has already been changed so that the only required field in PatternReplaceTokenFilter is pattern, but that change is not in any release.

The changes to PatternReplaceTokenFilter from main should be backported, or the code in the v2.x branch should be updated so that the only required field is pattern.

What alternatives have you considered?

Setting flags to an empty string allows the index to be created

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing PatternReplaceTokenFilter on the main branch with its implementation in the v2.x branch. Trace how the v2.2.0 client marks the fields as required and locate any existing tests for this token filter or custom analyzers. Done means the v2.x implementation matches the main-branch required-field behavior and the relevant validation is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.