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

Partial Index Update #34

Closed Blackglade closed 4 years ago

Blackglade commented 5 years ago

Anyway to implement this: https://www.algolia.com/doc/api-reference/api-methods/partial-update-objects/

or this: https://www.algolia.com/doc/api-reference/api-methods/save-objects/

so that the entire Index isn't updated at build and only the changed values in the index are updated?

Haroenv commented 5 years ago

One thing to note is that partial update objects will still cost the same amount of operations, since it would be called even if there's nothing to update.

There's an experiment by someone in the community in #27 you can try out with the plugin gatsby-pluign-algolia-search they published to try it out.

fraserisland commented 4 years ago

@Haroenv I'm a bit confused on how this would cost the same amount of operations, wouldn't allowing partial updates only index the updated items which for example could mean only 1 index operation vs 3000(or whatever your index size is)?

Haroenv commented 4 years ago

Unfortunately for this use case, a partial update which didn't cause any change still counts as an operation. The correct way to solve this for operations is not doing the API calls, as done in #27

Haroenv commented 4 years ago

This has been implemented as enablePartialUpdates: true in 0.8.0