travis-r6s / gridsome-plugin-flexsearch

Add lightning fast search to Gridsome with FlexSearch
24 stars 7 forks source link

Support callback function or regex in autoFetch #75

Open louis-l opened 2 years ago

louis-l commented 2 years ago

Hi,

Thanks for the awesome plugin. I have a use case where the search component is shared in multiple pages (e.g. /docs/my-help-article-1...) I checked https://github.com/thetre97/gridsome-plugin-flexsearch/blob/main/gridsome.client.js#L67 and it seems like the autoFetch is being "hard checked". So my suggestion is to support a callback function or regex or prefix (e.g. "/docs/*").

Cheers,

travis-r6s commented 2 years ago

Hey @louis-l - good suggestion. Feel free to create a PR, or I will work on this when I get a chance.

louis-l commented 2 years ago

@thetre97

Here you go: https://github.com/thetre97/gridsome-plugin-flexsearch/pull/76