Updating Multiple Records with Typesense
TLDR Shabber wanted to update multiple records based on ids. Kishore Nallan suggested using the import endpoint with 'update' action mode and provided examples.
Jun 09, 2023 (4 months ago)
Shabber
12:28 PM-H "X-TYPESENSE-API-KEY: oKsdsdsd7D2SXjtd6MjXxWjjlkkhjc5mQeGpcU2OdfvdsfdsOXl7zZmuWfqaWsdsdc9rG6Ohw" \
http://localhost:8108/collections/BooksNewStar
for delete this works, but need to update individual records based on id
Kishore Nallan
01:44 PMupdate
action mode: https://typesense.org/docs/0.24.1/api/documents.html#index-multiple-documentsJun 12, 2023 (4 months ago)
Shabber
04:36 AMShabber
04:59 AMcurl "" -X POST \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-d '{
"id": "124",
"company_name": "Stark Industries",
"num_employees": 5215,
"country": "USA"
}'
Shabber
05:00 AMKishore Nallan
05:14 AMKishore Nallan
05:14 AMShabber
05:15 AMTypesense
Indexed 2786 threads (79% resolved)
Similar Threads
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.
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.
Updating Multiple ID's in a Single Call
Hari asked about updating multiple ids in a single call. Dima suggested bulk import and Jason suggested sending partial documents with `?action=emplace`.
Issue with Typesense Schema and Ruby Client
Mateo faces issues while creating a schema and using Ruby client for Typesense. Jason suggests using a new field instead of 'id' and provides assistance for Ruby client errors.
Updating Documents by Query and Sorting by Float Fields
Saurabh asked how to update documents by query and whether float fields can be used for sorting. Kishore Nallan provided information on updating by query and advised using int64 type instead of float for unix timestamps.