Closed ibedarev closed 3 years ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
I hit the same use case: searching through complex objects with array property, each object usually has multiple matches inside the array property which are scored individually (can be seen in FuseSortFunctionArg
), but these scores are unavailable in FuseResult
, where we only get overall scores for each object as a whole.
It's useful to know each matches score individually so as to be able to display only the selected best matches from the array to the user.
Description
Add score to matches result. It allows filter nested arrays
Describe the solution you'd like
change transformMatches function to
function transformMatches(includeScore) return function (result, data)
inside addUse case
Sorting nested arrays in search result
matches.filter((m) => m.key === 'specific.neste.path').sort(sortMatches)