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

Do we still need the MatchFields and enablePartialUpdate options in config? #183

Closed drooJohnson closed 1 year ago

drooJohnson commented 1 year ago

Hello! I'm working in a project that was started before this plugin reached v1.0.0, and while reading through the changelog I noticed that the matchFields and enablePartialUpdates options don't appear anywhere in the source code of this repo, and it seems like they're no longer used.

Are we good to just remove them from our gatsby-config.js, or do we need to keep them around to ensure the behavior of the plugin doesn't change from what we were expecting?

The current values are:

enablePartialUpdates: true,
matchFields: ['identifier','modified'],

These look like the default values for older versions of the plugin, but I'm having trouble understanding exactly the process of how we should move from pre v1.0.0 versions of the plugin, and the current version of the plugin. This passage in particular left me a little puzzled.

For migrating to v1 version smoothly:

add id instead of objectID in your query
query for internal { contentDigest } and do not transform it
set enablePartialUpdates to true
set matchFields to ['internal.contentDigest']

Are we intended to do those things before we upgrade to v1+ to match the behavior we should expect by default in v1+, or are those the steps we need to take once we upgrade to v1+. Thanks in advance for the clarification!

Haroenv commented 1 year ago

Sorry that's unclear! happy to take a PR in clarifying the text. It means that before you update to v1, you do a final index with those changes made in your configuration, which then will have the same settings as v1 will use. Then you can update and do more indexing as before.

hope that helps!

drooJohnson commented 1 year ago

No worries, greatly appreciate the clarification! I honestly don't know if there's a better way to word it, I suspect my misunderstanding is an outlier. Thank you!