-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow for [ObjectId] Modification #181
Comments
Another option to handle this would be to allow |
The Transform function gets the full payload for manipulation and enrichment, including the |
Closing this since the object id can be modified in the transform function. |
Can you provide an example of what this transform function should look like? For some reason I am still not able to get this to work |
****Hi @smomin this issue needs to be opened back up. Currently, ObjectID modification does not work as intended when deleting indexes from Algolia. Here is my following code for the Firebase transform function:
In this example, i set the objectID to a different key called Algolia indexes are not properly deleted either through deleteDoc OR directly from deleting the document inside of the Firestore database. Modifying information in the document either via setDoc with {merge:true} or alternatively directly through the Firestore works fine. This is due to the transform function not running when an index is deleted in Algolia. Can we please get a fix/status update regarding this issue? |
@smomin How about just add a configuration option to use full document path as the object ID instead of document ID? It's simple and saves an extra unauthenticated endpoint. |
I agree. This is ubiquitous and allows for index-wide unique object IDs, while still allowing for documents across different subcollections to still share the same document name. |
hey @Luluno01 @Kashi-Datum I have a branch on alt-objectId that I am working on that allows the use of any document property. I need to add the ability to use document path. I am hoping to get this done by this week. |
hey @Luluno01 @Kashi-Datum try out the RC, https://console.firebase.google.com/project/_/extensions/install?ref=algolia/firestore-algolia-search@1.2.1-rc.0. This allows you to configure a different ObjectID. |
Thanks for the update! Unfortunately, I found another issue that led to my own implementation of functionalities similar to what this extension does. More specifically, I want to index two collections with the same collection ID but slightly different fields, which are imported together by this extension into one index. This is, however, another issue that is unrelated to configuration ObjectID. Anyway, thanks for your help! |
hey @Luluno01 any reason for not installing the extension twice so you are able to monitor the changes in two collections? You can install and configure the extension per collection and point it to the same Algolia index. I am just curious if I am missing something here. |
Thanks for asking. I tried installing the extension twice, but the issue is |
Any feedback on the RC release to configre another ObjectID |
Algolia uses the Firestore document id as the object id. However, that can create limitations. Take this example:
users
user1
,user2
, anduser3
.connections
where users have relationshipsuser1
is connected touser3
anduser2
is also connected touser3
users
/{user1
}/connections
/{user3
}users
/{user2
}/connections
/{user3
}In their specific contexts, they are different records, but when if I were to source my data from Firestore to Algolia using the phrase "
users
/{userId
}/connections
", the two records will be treated as the same (therefore duplicitous), meaning that one of them will be left out.FIX
During the Firebase extension configuration, we can enable objectId modification in such contexts. The question would be -
"Collection path contains duplicate id? yes/ no"
Yes - the extension generates new objectId strings and save them to algolia
No - current behavior continues
The text was updated successfully, but these errors were encountered: