Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Search on onkeyup? #6

@zzrez

Description

@zzrez

Am reading your tutorial https://assortment.io/posts/gatsby-site-search-lunr-js where you ask for feedback. Hope here is OK. The tutorial is excellent. I have made a version of the blog with more text and frontmatter to check out functionality.

I noticed that mostly you have to type a full word in the search box before results are triggered. Just a few exceptions showed results before, eg entering "sweep" showed a record with "sweeping", and "privat" showed record with "private". But you must enter the entire word to get a record with "peninsula". Is there any way to trigger search after each onkeyup instead?

Subject to the above, the Submit button seems unnecessary as results appear when typing in the search term.

One last finding on search: once the search is triggered and results appear, if you carry on typing these results do not change. This is not desirable. For example one record has "look no further", another has "looking". Both appear after entering "look" but stay there after extending the search to "look further". Is there an easy solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions