Updating Documents by Query and Sorting by Float Fields
TLDR 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.
1
May 25, 2023 (6 months ago)
Saurabh
09:15 AMCan't We Update Documents By Query ?
Jason, Kishore Nallan
Kishore Nallan
09:24 AMSaurabh
09:29 AMSaurabh
09:29 AMKishore Nallan
09:33 AMSaurabh
09:35 AMKishore Nallan
09:39 AMSaurabh
09:41 AMKishore Nallan
09:53 AMSaurabh
09:53 AMSaurabh
09:54 AMKishore Nallan
09:56 AMKishore Nallan
09:57 AMSaurabh
09:57 AMKishore Nallan
10:24 AMSaurabh
10:25 AMKishore Nallan
10:40 AM
Saurabh
10:40 AMKishore Nallan
10:41 AMSaurabh
10:53 AMKishore Nallan
10:56 AMSaurabh
11:05 AM{
"document": {
"name": "Marketing Communications Management - MSc",
"published_date": "2021-12-19 17:10:02.652000",
"published_date_unix": 16399140026520.0,
"sort_order": 1246
},
"highlight": {},
"highlights": []
},
{
"document": {
"name": "Marketing and Brand Management - MSc",
"published_date": "2021-12-19 17:10:02.645000",
"published_date_unix": 16399140026450.0,
"sort_order": 1246
},
"highlight": {},
"highlights": []
},
{
"document": {
"name": "International Business and Marketing Management - MSc",
"published_date": "2021-12-19 17:10:02.567000",
"published_date_unix": 16399140025670.0,
"sort_order": 1246
},
"highlight": {},
"highlights": []
}
}
Saurabh
11:06 AMKishore Nallan
11:11 AMSaurabh
11:11 AMKishore Nallan
11:23 AMSaurabh
11:23 AMKishore Nallan
11:24 AMSaurabh
12:36 PMSaurabh
01:03 PMKishore Nallan
01:52 PM
We don't have change log yet for 0.26.0.
Saurabh
01:55 PMKishore Nallan
01:56 PM{
"filter_by": "<condition>"
}
Saurabh
01:58 PMclient.collections[collection_name].documents[document_id].update(document)
Kishore Nallan
01:58 PMdocument = {
'company_name': 'Stark Industries',
'num_employees': 5500
}
client.collections['companies'].documents['124'].update(document, {"filter_by": "<condition>"})
Saurabh
01:58 PM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Issue with Embedding Error in Version 0.25.0.rc63
Bill reported a bug in version 0.25.0.rc63 regarding a problem with updating or emplacing a document and receiving an embedding error. This was resolved in version 0.25.0.rc65, but further discussion ensued regarding the function of 'index' in the update feature.
Editing and Updating Schema in Typesense Cloud
Loic sought help editing their Typesense Cloud Schema and adding search parameters. Jason guided them on how to drop a field and add another parameter for searching.
Typesense Bug Fix with `canceled_at` Field and Upgrade Concerns
Mateo reported an issue regarding the treatment of an optional field by Typesense which was confirmed a bug by Jason. After trying an upgrade, an error arose. Jason explained the bug was due to a recent change and proceeded to downgrade their version. Future upgrade protocols were discussed.
Sorting Results in Typesense and Handling Errors
Ramees asks about sorting results by distance in Typesense, entering a list of strings as a field, and resolving an error with `fields` format. Kishore Nallan assists with these issues and advises on storing timestamps and proper authentication.
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.