olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.87k stars 546 forks source link

Issue with wildcard after a dash character #491

Open gilisho opened 3 years ago

gilisho commented 3 years ago

See here: https://codesandbox.io/s/lunr-end-special-char-forked-e8f2x

Some background:

This is my data that is being indexed:

const data = [
    {
      id: "1",
      body: "create-site-good"
    },
    {
      id: "2",
      body: "hello-react"
    },
    {
      id: "3",
      body: "app-"
    }
  ];

I'm also removing lunr.trimmer from the indexing pipeline so special characters are indexed (this.pipeline.remove(lunr.trimmer)).

The expected result of create-site-* is only article 1, but the search results are not related at all...