elasticsearch/docs/reference/migration
Christoph Büscher 1597f69e44
Make Fuzziness reject illegal values earlier (#33511)
The current java implementation of Fuzziness leaves a lot of room for
initializing it with illegal values that either cause errors later when the
queries reach the shards where they are executed or values that are silently
ignored in favour of defaults. We should instead tighten the java implementation
of the class so that we only accept supported values. Currently those are
numeric values representing the edit distances 0, 1 and 2, optionally also as
float or string, and the "AUTO" fuzziness, which can come in a cusomizable
variant that allows specifying two value that define the positions in a term
where the AUTO option increases the allowed edit distance.

This change removes several redundant ways of object construction and adds input
validation to the remaining ones. Java users should either use one of the
predefined constants or use the static factory methods `fromEdits(int)` or
`fromString(String)` to create instances of the class, while other ctors are
hidden. This allows for instance control, e.g. returning one of the constants
when creating instances from an integer value.

Previously the class would accept any positive integer value and any float
value, while in effect the maximum allowed edit distance was capped at 2 in
practice. These values while throw an error now, as will any other String value
other than "AUTO" that where previously accepted but led to numeric exceptions
when the query was executed.
2019-04-05 10:35:35 +02:00
..
apis Remove Migration Upgrade and Assistance APIs (#40075) 2019-03-15 15:34:50 -06:00
migrate_8_0 Make Fuzziness reject illegal values earlier (#33511) 2019-04-05 10:35:35 +02:00
index.asciidoc [DOCS] Removed redundant (not quite right) information about upgrades. 2019-04-04 16:20:08 -07:00
migrate_8_0.asciidoc Make Fuzziness reject illegal values earlier (#33511) 2019-04-05 10:35:35 +02:00
migration.asciidoc Remove Migration Upgrade and Assistance APIs (#40075) 2019-03-15 15:34:50 -06:00