minisearch
minisearch copied to clipboard
Prefix search not working
Hi
package version: 5.0.0
Currently i use minisearch like this
const data = [
{
"title": "Old Man's War",
"author": "John Scalzi"
},
{
"title": "The Lock Artist",
"author": "Steve"
},
{
"title": "Artist for Life",
"author": "Michelangelo"
},
{
"title": "Artists for Life",
"author": "Michelangelo"
}
];
const searchOptions = {
combineWith: "OR",
searchOptions: {
prefix: true,
fuzzy: false
}
}
const query = 'Artist';
const engine = new MiniSearch({
fields: ['title'],
searchOptions: searchOptions
})
engine.addAll(data);
const searchResult = engine.search(query);
I get a search result if there is the word "Artist" but not i.e. "Artists" . What am i doing wrong here?
Another question, "Awesomeartists" would never match (its not a prefix), or am i wrong?