Ensuring Uniqueness During Records Creation in Typesense
TLDR Krish inquired about ensuring uniqueness during record creation in Typesense. Kishore Nallan explained that uniqueness can be maintained using the 'id' field in documents, and when creating documents, the system automatically assigns a unique id if none is provided.

Dec 14, 2022 (9 months ago)
Krish
08:20 AMKishore Nallan
11:04 AMid
field in the document is used as the identifier by convention. It can be used to ensure uniqueness.Krish
11:31 AMKishore Nallan
11:31 AMKrish
11:32 AMKishore Nallan
11:33 AMid
is provided then id
is autoassigned in running sequence. If an id
is provided we will use that.Krish
11:34 AMKishore Nallan
11:34 AMreturn_id=true
flag then the created id
is returned (in 0.24 RC)Krish
11:35 AMKrish
11:37 AMKishore Nallan
11:38 AMid
must be a string. You can just hash the document to produce a SHA and use that as ID.Krish
11:38 AMKishore Nallan
11:39 AMKrish
11:40 AMKishore Nallan
11:40 AMKrish
11:40 AMKishore Nallan
11:41 AMid
happens to be an integer simply because we have a running sequence to choose from that won't duplicate but it can be anything.Krish
11:41 AMKrish
11:42 AM
Typesense
Indexed 2764 threads (79% resolved)
Similar Threads
Understanding Document ID Fields and Rectifying Duplicate Document Error
John queried about understanding document ID fields and fixed a duplication issue with guidance from Jason. They discovered a bug preventing document deletion due to a URL encodable character, with John opening a GitHub issue for it.


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.
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.


Troubleshooting Create Index Issue on Typesense Instance
John was having issues creating new indices on a Typesense instance which Jason suggested could be due to old bugs or heavy search queries monopolizing CPU. After a restart, the issue was resolved. Jason also recommended upgrading the Typesense version.

Threading Problem During Multiple Collection Creation and Batch Insertion in Typesense
Johan has a problem with creating multiple collections and batch-inserting documents into Typesense, which is returning results from different collections. Kishore Nallan helps troubleshoot the issue and suggests a potential local race condition, which is fixed in a later build.