apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.45k stars 973 forks source link

Refactoring ShingleFilter: Final Fields, Builder Pattern, and Constructor Update #13390

Open iamsanjay opened 1 month ago

iamsanjay commented 1 month ago

Description

13112

Made fields final and removed their respective setters. Introduced the Builder pattern to facilitate the construction of ShingleFilter instances. All previous ctors have been removed and replaced with a new one that accepts a Builder object as an input parameter (Used @IgnoreRandomChains to pass the test for now).

Since ctors were removed, an entry in MIGRATE.md is necessary, as Elasticsearch relies on this class, according to a GitHub search.

If the Builder pattern is not preferred, we could discard this approach and consider using chaining constructors instead.

github-actions[bot] commented 1 week ago

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution!