typesense / gatsby-plugin-typesense

A Gatsby plugin to automatically index content to Typesense post-build
Apache License 2.0
34 stars 11 forks source link

Creating multiple collections? #6

Closed artt closed 3 years ago

artt commented 3 years ago

I tried to find this in the doc but couldn't. Let's say I have the following:

/public
- /posts
- /authors

I'd like two collections (each with different schema). It seems like from the config in gatsby-config.js I can only input one collectionSchema. So I'm wondering how I can have more than one collection schema, based on the directory of the html files. Thanks!

artt commented 3 years ago

Just found out that you could include two (or more) instances of the plugin, so you can create multiple collections that way.

jasonbosco commented 3 years ago

Oh I see! I did not know you could do that. I thought I'd have to modify the adapter to support this.

Mind sharing how you set this up, with code snippets? I can then add this to the docs. Or feel free to submit a PR adding this to the README file as well.

artt commented 3 years ago

Just submitted PR #7. Thanks!

jasonbosco commented 3 years ago

Thanks @artt!