Register a weight and/or comparator for a field path in one call.
This is the most common extension point. Either weight or comparator (or both) may be provided; omitted properties are left unchanged.
weight
comparator
Dot-notation field path.
An object with optional weight and/or comparator.
registerPlugin('userAgent', { weight: 25, comparator: (a, b) => levenshteinSimilarity(a, b),}); Copy
registerPlugin('userAgent', { weight: 25, comparator: (a, b) => levenshteinSimilarity(a, b),});
Register a weight and/or comparator for a field path in one call.
This is the most common extension point. Either
weightorcomparator(or both) may be provided; omitted properties are left unchanged.