-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: modify document ID during sync #170
Comments
Maybe it is the same problem, right? #171 |
Could be the same root cause/fix, but the goal is different: this issue/request deals with overlapping/colliding document IDs, and #171 is dealing with overlapping/colliding collection names. So I would say it is a different thing; this is also not a bug, but a feature request. |
This feature is quite important, no feedback yet? |
hello @go-sean-go I have created a RC of the extension that allows you to change the Object in the configuration. Please try it out and let me know if it solves your problem. https://console.firebase.google.com/project/_/extensions/install?ref=algolia/firestore-algolia-search@1.2.1-rc.0 |
@smomin Can you confirm how to use the field? Are the valid values either (a) In the case of option (b), must the value of the property name remain stable? Or, if it changes over time (some time after create), would the object ID of the document on the Algolia side change as well? |
The valid values are below:
|
thanks @smomin - regarding my other question using e.g. the
Basically, if the I'm trying to consider the practical use case for the property value option. Separately, a question on the Considering these scenarios, if I might suggest a simpler feature to solve the original issue + avoid these scenarios (which would likely be unintended from the user side): perhaps we should simply offer a simple checkbox option that hashes the full path (VERY LONG STRING) to a standard UUID-length string. This would provide uniqueness, idempotency, and I believe handle even extreme edges of the Firestore quotas - if I'm reading it right & thinking about it right. Anyway, just my two cents. Let me know about the above. |
hey @go-sean-go sorry for missing this but are you concerns still valid? Let me know you feedback on the RC release. |
I haven't re-tested since my original comment - so I'm not sure. If no changes have been made to the feature/code, then yeah, my questions would still be outstanding. Overall, per my comments above, I don't think the current solution is very durable or clear. The hash mechanism I suggested above would be something to explore (not my area of expertise), I believe - as long as it has a sufficiently large capacity. To repeat my concerns:
|
(see Question at the end)
I have sync'd an index between Firestore and Algolia. In my case it's a subcollection of feed items, such that when
User1
creates a post (let's call itPost1
), ifUser2
andUser3
followUser1
, they both get a copy ofPost1
in a subcollection.Here is the data structure, then, after creation/replication:
You may already see the problem here: I have 3 documents with the same document ID (
Post1
).In Firestore land, this is totally fine; typical use cases generally query subcollections with this sort of syntax:
query.collection(users/${userId}/feed).get()
- in other words, you've already automatically filtered the returned feed items to prevent duplicate Ids.In Algolia, it appears that with this configuration, the documents are simply re-written many times, and there is only one copy of
Post1
in the end.Question: perhaps this can be solved with a
Transform Function Name
function? If so, how would I change the document Id...? I can experiment with this next week, but the documentation here is very light, so I don't want to sink too much time into it if the maintainers can simply speak to it here.The text was updated successfully, but these errors were encountered: