a8m / a8m/angular-filter

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

未關閉
#173 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
2.9k
分支
319
PR 合併指標
30 天內沒有已合併 PR

描述

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
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。