Document Overlapping Issue in Collections
TLDR Patrick faced issue with documents from one collection appearing in another when using the javascript library. Kishore Nallan suggested instantiating separate client objects and fixed an identified potential race condition in a newer build. Patrick confirmed the fix worked, resolving the issue.
2
Jul 19, 2022 (17 months ago)
Patrick
03:05 AMKishore Nallan
03:14 AMclient
object being shared across different parts of the code at the same time. Can you try instantiating separate client objects?Patrick
03:16 AMYes I can, would I want to scope the client per collection?
Kishore Nallan
03:22 AMTo be clear you will face this problem only when two async functions end up sharing the same client which accesses two different collections.
Patrick
03:38 AMI tried creating a client cache per collection name (actually alias name if that makes a difference) but I am still having the same problem
Kishore Nallan
03:46 AMPatrick
03:50 AMKishore Nallan
03:51 AMPatrick
04:05 AMKishore Nallan
04:06 AMPatrick
04:16 AM/*if (threads.length > 0) {
await collection.documents().import(searchThreads, { action: "upsert" })
}*/
await Promise.all(searchThreads.map(c => collection.documents().upsert(c)))
I'll do a little more testing tomorrow and see if I can see what actually make a difference
Patrick
04:21 AMKishore Nallan
04:41 AMPatrick
04:54 AM1
Kishore Nallan
11:19 AM0.24.0.rc20
build. Could you please test against that to see if it helps? I've published to Docker.1
Patrick
04:35 PMPatrick
04:35 PMPatrick
04:36 PMJul 20, 2022 (17 months ago)
Kishore Nallan
06:26 AMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
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.
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.
Typesense Server Bulk Import/Upsert Issue Resolved
Adam was confused about the discrepancy between the successful responses and the actual indexed data while working with a custom WP plugin integrating with Typesense. The issue was a bug related to fetching documents in the wrong order, not a Typesense problem.
Troubleshooting Indexing Duration in Typesense Import
Alan asked about lengthy indexing times for importing documents to Typesense. Jason suggested various potential causes, including network connectivity and system resources. They later identified the problem to be an error in Alan's code.
Issue with Field Indexing and Multiple Data Types
Raymond encountered an issue where a field seemed to be indexed twice and hence couldn't be deleted. Jason advised upgrading to a patch version, but the problem remained. Kishore Nallan suspected a race condition and an issue with conflicting data types. An effective solution wasn't achieved.