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

How to perform full word searching in Lunr.js for Svelte? #526

Open AnanduVFX opened 1 year ago

AnanduVFX commented 1 year ago

Please go through the sample svelte application which uses the Lunr.js library to perform searching through a document: Lunr.js - Svelte

I am trying to search for the term 'example'. However, I am only able to get the expected result if I type 'exampl'. I would like to search through the document and print results for every matching item when pressing a key. I tried using the wildcard (*) property like so:

results = index.search(query + '*')

Using this method, I am able to print the matching result for every key press. However, when I type the full word 'example', the result is empty.

How can I perform single, partial, and full word searching?