algolia / firestore-algolia-search

Apache License 2.0
112 stars 35 forks source link

Only updating a bool does not update record in index #44

Closed Albert-Jan closed 3 years ago

Albert-Jan commented 3 years ago

Everything works as expected and syncs perfectly except booleans. If a new document is created it gets loaded in. However if only the boolean field gets updated, it doesn't update it. The field is called 'hidden' so not sure if that's a problem.

The logs for my cloud functions do not show an error. However the bool does not show up inside the data being transmitted. The field 'hidden' is in my indexed fields settings for the plugin.

Would love to hear how to continue. Version: 0.4.1

Edit: apparently the same thing goes for numbers. I tried to change the field type to string and the 'hidden' value syncs perfectly. So it really depends on the type and not on a configuration setting.

smomin commented 3 years ago

Hey Albert, so you are saying that in Firestore, a field with data type boolean and/or number does not sync with Algolia?

Albert-Jan commented 3 years ago

Exactly! Although on initial creation it does create the field, however not after any other field in the document gets updated. Please let me know if you're able to recreate it

smomin commented 3 years ago

ok, i will look into this issue this week.

smomin commented 3 years ago

@Albert-Jan I created a new Field with a Boolean type. This triggered a reindex. I changed the value and it also triggered an index. I was able to successfully do this for fields with number as data type. Can you create a video of the issue for me to really see the problem.

Albert-Jan commented 3 years ago

Hi! Thanks, I've attached a video demonstrating the issue that I'm facing. As you can see, changing the type of the field 'hidden' from bool to string updates it correctly. However when it is a bool, the field never gets updated.

Video on Google Drive

smomin commented 3 years ago

Thanks for the video. Can you send me your extension configuration for the Fields?

Albert-Jan commented 3 years ago
Screenshot 2021-06-24 at 21 08 39
Albert-Jan commented 3 years ago

Please let me know if you need anything else! Thanks for following up with me!

smomin commented 3 years ago

Ok, figured out the issue. I will get a PR ready for the fix.

Albert-Jan commented 3 years ago

Thank you for the quick assistance and fix! Everything works as expected now. 😄