algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
177 stars 45 forks source link

feat(environment): Added functionality to perist entries from different instance. #116

Open kulak-at opened 3 years ago

kulak-at commented 3 years ago

Context I am currently working on a project with federated search combining results from multiple gatsby instances. I've wanted to use this plugin but realized it is clearing all the results that did not appear in the new run. I've added an option to skip the results added from the different environment (i.e. different gatsby instance).

Haroenv commented 3 years ago

Thanks for your PR! Could having a specific matchField for each one of the environments work?

kulak-at commented 3 years ago

Unfortunately, the matchField itself doesn't cover this use-case. The items I want to preserve in my case are the entries that are generated from different gatsby instance so there's nothing I can match the entries against and they will always be removed. Maybe there's another way to use matchField to cover that you have in mind but I don't see a straightforward solution.

Serjlee commented 3 years ago

I think this would be a useful addition, as I just found myself in a similar case: we got multiple "documentation" websites using different technologies, and it makes sense for us to use a single index because of the search app UX, and because of the content itself

We already got a couple (non-Gatsby) applications sharing a single index, and the ability to also share it with a Gatsby site would be extremely handy