Closed matrix4123 closed 4 years ago
I would put that attribute in the "modified" array as well, when you're just adding it. At a later point you can remove that entry again to prevent unneeded updates.
The ideal way to fill the modified array is to have the hash of the object itself (minus the hash itself of course). This way it will always update when something in the object updates.
@Haroenv What array are you referring too? I don't see any documentation specifically for "modified".
I'm having the same problem, doing the partial update manually (as shown in https://www.algolia.com/doc/api-reference/api-methods/partial-update-objects/) works just fine
Sorry, I meant to ask what your schema of your object is, as well as what you have written inside matchFields
https://github.com/algolia/gatsby-plugin-algolia#advanced
Solved my problem by adding a updatedAt
field to my queries and then adding matchFields: ['updatedAt']
I added an "UpdatedAt" previously... but in my case I am scraping the UpdatedAt from a remote object store, so this value doesn't change after I add a new field.
you could add the name of the new field to the matchFields array, something like this should work
matchFields: ['updatedAt', 'mynewfield']
then, everytime the value of mynewfield
or updatedAt
is different than the one on your index, that entire record will be updated
I think what @vscncls is suggesting makes the most sense, so I'll close the issue for now, in case it's still not solved the issue, don't hesitate posting an example of the dataset + full Gatsby setup where we can reproduce
When partialUpdates is enabled, a new attribute was not detected and added to my records. Was curious if there was any way to detect a completely new attribute added to the record and add it.