Closed NickBarreto closed 3 years ago
Thanks @NickBarreto, these changes look good. FlexSearch actually accepts either an object of options, like you describe, or a preset name, like "performance".
Since FlexSearch 0.7, the "speed" preset is no longer mentioned in the FlexSearch documentation. I assume this means it has been removed so we should remove it from gatsby-plugin-prismic-preview
's README.
Do you mind updating the description to mention presets as I think most users would prefer simpler setup rather than granular control? Presets are listed under the Index Options in the link you added to the docs.
Hi @angeloashmorem, sure thing. I've updated the base option in the example gastby config, and added a bit more about the presets as well as various options, including showing how the examples from the FlexSearch Usage documentation would be created using engineOptions instead.
This plugin is working really well for me, especially now I've grokked how to adjust the FlexSearch settings, so hopefully this'll be really useful for others. My index is getting a little big though so I'm about to start making use of the publicURL functionality to load things in more conditionally – I think it's a great setup.
Perfect, thanks for writing this! If you have any strategies to share, feel free to update the README. We could add a FAQ or Recommendations section.
Yeah, in currently failing to properly consume the index and store by fetching them when my search components mount. So when I've figured that out I may add some advice to that section (though maybe it's more of an issue with my usage of react-use-flexsearch).
I can find and fetch the files just fine, and set them to a state, and everything works and even looks fine on inspection till I turn off my loading state. When I do that, I'm getting a cors error. I don't think that's the issue though, because the console is also giving me an "unexpected token o at position 1" error, even when I'm not transforming the fetched data into JSON. Something isn't quite right – like I said when I've figured it out I may expand on that section with some advice.
The example gatsby-config file is setup is misleading in appearing that the engineOptions accepts a string, rather than the actual usage of it taking an object with the FlexSearch Index options, so I think it's worthwhile to add a section briefly explaining the usage.