Organizing Document Updates in User-Focused Database
TLDR Gabriel had a question about managing document updates per user across various collections. CaptainCodeman and Jason suggested maintaining additional information about documents. After discussion, Gabriel proposed a solution involving a second map including collections.
Mar 16, 2022 (18 months ago)
Gabriel
02:24 PMI have a use case, where user updates his info and then all his documents need to be updated in the search, so I have a bunch of document id's to update, but I don't really know which collections they sit in.
So I can loop all collections and then do the import/update, which will then also throw some errors if the doc doesn't exist.
Is there a smarter way to do this?
CaptainCodeman
03:31 PMJason
04:00 PMHow do you import documents into these different collections the first time around?
Jason
04:01 PMGabriel
08:54 PMBut on the user itself, then I only store the doc id's, without the collection.
I guess I could store the collection as well, but that makes the structure a bit more nested.
To explain the use case:
1. user logs into like slack community 1.
2. creates a doc, the doc is uploaded to community 1.
3. doc id is stored on the user (createdDocs:[ 'id1', 'id2' ])
So if a user name changes, then all ids for docs should be updated.
I guess the solution would be to create a second map that includes the collections as well so:
docInfo : { 'col1' : [ 'id1', 'id2' ], 'col2' : ['id3', 'id4'] }
Jason
09:13 PMDidn't get this part... Why do docs IDs change when a username changes?
Gabriel
10:19 PMWhat I meant is that all docs need to be updated with the new user info.
Typesense
Indexed 2764 threads (79% resolved)
Similar Threads
Methods for Fetching, Querying, and Modifying Collections in Typesense
Bill inquired about performing OR queries, querying empty arrays and modifying collections in Typesense. Kishore Nallan explained the current limitations and provided workarounds and recommendations for each case. The conversation also touched upon the usage of cache in Typesense and the workings of the _eval function.


Handling Kinesis Stream Event Batching with Typesense
Dui had questions about how to handle Kinesis stream events with Typesense. Kishore Nallan suggested using upsert mode for creation/update and differentiating with logical deletion. After various discussions including identifying and resolving a bug, they finalized to introduce an `emplace` action in Typesense v0.23.


Optimizing Document Re-ingestion in Typesense
Viktor and Elyes discuss ways to handle frequent doc updates in Typesense. Kishore Nallan recommends using the update/upsert mode, data sharding, and the emplace action for efficient re-ingestion.