-
Notifications
You must be signed in to change notification settings - Fork 36
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
Improve support for subcollections by propagating dynamic vars and backfilling collectionGroup #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small nitpicks I noticed
ec42514
to
e3fdd60
Compare
updated. let me know any other comments or feedback |
lgtm! |
Thank you for the PR @jsasitorn. This is now available in this RC version: https://github.com/typesense/firestore-typesense-search/releases/tag/v2.0.0-rc.0 Could you install the RC version of the extension using the installation link above and let me know how it goes? |
@jasonbosco tested both indexOnWrite and backfill on my data set (~600 entries), data appears to be all there. Noticed some innocuous errors addressed in #100. Also, couple of things I noticed testing:
|
Thanks @jsasitorn. Published PR #100 in v2.0.0-rc.1
@tharropoulos could you add this to the README?
Yeah, may be we should add a |
@jasonbosco adding a firestore call to |
Thank you all for this! |
@jsasitorn Good point. Adding a debug mode to extensions.yml sounds good to me. |
Change Summary
Currently users can provide dynamic collection paths in typesense config, "users/{userId}/books" even though this isn't properly supported. This improves Firebase plugin support for subcollections in indexOnWrite and backfill by the following:
For onWrite, pass context.params so that placeholders in a dynamic collection path, e.g. users/{userId}/books/{bookId}/chapters, are also indexed in typesense, thus allowing querying not only for a chapter with title="Intro" or id=789, but also userId=123 and bookId=456.
For backfill, query using .collectionGroup(collectionGroup), to backfill following a dynamic path: "users/{userId}/books/{bookId}/title".
This draws inspiration from #93 to improve backfills. However, this version adds guards to prevent group backfills for static paths: e.g.,"users/123/books/456/chapters" and unrelated paths, e.g. using .collectionGroup("books") could end up backfilling both "books" and "users/{userId}/books".
Only change to the typesense collection is the inclusion of ids in the dynamic path.
PR Checklist