Importing Document IDs for Future Updates in Node.js Typesense Client
TLDR Priyank needs help using document IDs for future updates. Kishore Nallan suggests sending return_id=true
GET parameter and corrects the field name in the code snippet.
1
Feb 06, 2023 (10 months ago)
Priyank
11:40 AMKishore Nallan
11:55 AMreturn_id=true
to the import API as GET parameter. Every row in the import response will now contain the id
of the document imported. You can use this for future updates.Priyank
11:56 AMPriyank
11:57 AMPriyank
11:57 AM const ids = await TypesenseClient.collections("listing")
.documents()
.import(servicesForTypesense, { action: "create", return_ids: "true" });
Kishore Nallan
11:57 AMreturn_id
(singular) but otherwise correct1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Adding and Updating Collections in Typesense Server
sonu asked about methods to add and update collections in a Typesense server. Jason advised that documents can be added individually or in bulk, and updates can be batched using the import function, even with a small React app with a MySQL database.
Issues with Typesense Import API Document Indexing
Morgan experienced inconsistent document indexing using the Typesense Import API. Jason clarified that Typesense returns a success: true or false for each record in the batch import call.
Updating Bulk Records and Resolving Typsense Issues.
Greg inquired about updating bulk records. Jason proposed using the documents/import endpoint for bulk updating, identified issues with Typesense, and provided solutions. Greg appreciated the assistance. Conversation related to the procedure was shared with Viktor.