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

Missing documents when upgrading to v0.8.0 #88

Closed lablancas closed 4 years ago

lablancas commented 4 years ago

I'm not sure if others have the same issue. I found that upgrading to v0.8.0 caused my index to lose the majority of the records. I am using the deduplication option in my Algolia index so that could be incompatible with the plugin starting with v0.8.0

I was able to install v0.7.0 to restore proper functionality.

Haroenv commented 4 years ago

Does this still happen with the latest version, IIRC in the original 0.8.0 there were some bugs still.

If you have a reproduction where this consistently happens, I'd love to see it.

Is it possible you have duplicate items for matchFields or modified?

lablancas commented 4 years ago

I have the same issue with 0.8.0 and newer. I did not enable partial updates so matchFields shouldn't matter, right?

While I was troubleshooting, I tried using enablePartialUpdates and matchFields to see if I could get the latest code to work, but nothing worked for me except reverting to 0.7.0

I will try to create a project that reproduces the problem.

Haroenv commented 4 years ago

Thanks for looking into this deep enough to make a reproduction!

lablancas commented 4 years ago

I figured out what the issue is. I was using id as my group by field in Algolia for search queries, but the plugin is normalizing records by id so I had to make sure every record had a unique id and save my group by field as a separate document field.