Skip to content

KeyClosestOptions

Options for KeyedFuzzyIndex.closest() and FuzzyObjectIndex.closest(): the KeySearchOptions fields that apply to finding the best match. The result is the first result of search() with these options and maxResults: 1. Other KeySearchOptions fields are not read.

Property Type Description
matchMode? KeyMatchMode How the query is matched against the keys of an item: 'perKey' (default) or 'crossKey', as in KeySearchOptions.matchMode. Any other value throws an InvalidArg error.
minScore? number Minimum combined score (0.0-1.0, see scoreMode): closest() returns null when the best match scores below it. NaN throws.
scoreMode? KeyScoreMode How the per-key scores of an item are combined into its score: 'weighted' (default), 'matched' or 'max', as in KeySearchOptions.scoreMode. Any other value throws an InvalidArg error.