travis-r6s / gridsome-plugin-flexsearch

Add lightning fast search to Gridsome with FlexSearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support callback function or regex in autoFetch

louis-l opened this issue · comments

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,

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

@thetre97

Here you go: #76