a8m / a8m/angular-filter

fuzzy and fuzzyBy produce false positives on long strings (too fuzzy?)

Open
#173 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.9k
Forks
319
PR merge metrics
No merged PRs in 30d

Description

While testing the `fuzzy` and `fuzzyBy` filters on some sample text, I noticed they tend to match any search term for long string data. The longer the text string, the more likely it will match on words that barely resemble the search string. This makes it hard to use effectively, since the filtered results have a very low signal-to-noise ratio.

``` js
var $filter = angular.element(document.body).injector().get('$filter');
var arr = [
{ text: 'foo bar' },
{ text: 'Curabitur ultricies metus eu neque luctus, vitae efficitur ' +
'quam elementum. Aliquam convallis diam et pretium placerat. Morbi ' +
'tellus turpis, sollicitudin eu nunc et, mollis sodales lectus. ' +
'Pellentesque lacinia augue id risus condimentum bibendum.'
}
];
console.log($filter('fuzzy')(arr, 'foobar').length); // returns 2
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.