Adding sortable tag field support & UNF support by slorello89 · Pull Request #1862 · StackExchange/StackExchange.Redis (original) (raw)

The main problem I can see here is the breaking change on TextField's ctor and the AddSortableTextField method which is going to cause MissingMethodException on anything that takes a transient dependency (i.e. not rebuilt explicitly). We usually try hard to avoid hard breaks, with the preferred method being: to add overloads rather than optional args.

For example:

could be achieved instead via:

public TextField(string name, double weight, bool sortable, bool noStem, bool noIndex) : this(name, weight, sortable, noStem, noIndex, false) {} public TextField(string name, double weight = 1.0, bool sortable = false, bool noStem = false, bool noIndex = false, bool unf = false)

Likewise:

could be

public Schema AddSortableTextField(string name, double weight) => AddSortableTextField(name, weight, false); public Schema AddSortableTextField(string name, double weight = 1.0, bool unf = false)