MihaiValentin / lunr-languages

A collection of languages stemmers and stopwords for Lunr Javascript library
Other
432 stars 162 forks source link

lunr.de fails with umlaute in wildcard search #80

Open jonex2 opened 3 years ago

jonex2 commented 3 years ago

Searching for words with umlaute fails if wildcard search is used:

const lunr = require('lunr')
require('lunr-languages/lunr.stemmer.support')(lunr)
require('lunr-languages/lunr.de')(lunr)

const idx = lunr(function () {
  this.use(lunr.de)
  this.field('text') 
  this.add({
    id: 1,
    text: 'das ist günstig'
  })
})

console.log(idx.search('günstig').length) // result: 1
console.log(idx.search('günsti*').length) // result: 0

I tried a workaround described in a comment of #66, but this didn't work. I would be very happy if the bug could be fixed in lunr.de