krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.76k stars 753 forks source link

Case insensitive searches do not work for some Turkish words #701

Closed bschlenk closed 1 year ago

bschlenk commented 1 year ago

Describe the bug

Turkish has specific rules for how I is lowercased, so some words are not found when expected. For example, the string Satış Teklifleri will not be found when searching for satış teklİflerİ.

Version

6.6.2

Is this a regression?

Not a regression

🔬Minimal Reproduction

const list = [
  { title: 'Satış Teklifleri' }
];

const fuse = new Fuse(list, { keys: ['title'] });

// results should contain 1 result, but contains 0
const results = fuse.search('satış teklİflerİ')

Additional context

This can be fixed by doing a find/replace for toLowerCase -> toLocaleLowerCase. This does require the end user's browser/os locale to be set to Turkish, but I think that is reasonable.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days