Adding new field to a collection issue in Typesense
TLDR Ankit receives a 'request malformed' error while adding a new field to a Typesense collection. Kishore Nallan explains the issue is due to schema validation. They advise creating a Github issue for supporting coercion. After Ankit reproduces the issue and shares details, Kishore Nallan acknowledges the issue and promises to investigate.
Sep 07, 2023 (2 months ago)
typesense.exceptions.RequestMalformed: [Errno 400] Schema change is incompatible with the type of documents already stored in this collection. Existing data for field `XXX` cannot be coerced into an array of string.
The XXX field in the schema is an object field that isn't indexed and just to show some display values and when adding to it we use coerce_or_drop. Why is another field being coerced when adding a non-related field? What would be the correct way to add a new field without caring about the schema within this object field.
Kishore Nallan10:42 AM
Kishore Nallan10:44 AM
Kishore Nallan10:45 AM
Kishore Nallan10:45 AM
Any plans or a ticket already in place to add a feature to avoid schema validation while doing schema updates on all fields or fields to exclude?
Kishore Nallan10:49 AM
Let me know if you need additional details.
Kishore Nallan11:10 AM
In our schema, XXX is a display object, so we didn't care about the schema much if data is available there we display it. So the keys within the object may be strings, arrays or objects.
Kishore Nallan11:29 AM
Once identified I'll update the issue.
Kishore Nallan11:30 AM
Sep 08, 2023 (2 months ago)
Kishore Nallan12:17 AM
Indexed 3011 threads (79% resolved)
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.
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.
Issues with Schema Creation and Nested Fields
Sean encountered a problem with schema creation involving auto nested fields. Kishore Nallan suggested checking the API response for errors and adding problematic fields to the schema as optional. Sean confirmed the advice.
Methods for Fetching, Querying, and Modifying Collections in Typesense
Bill inquired about performing OR queries, querying empty arrays and modifying collections in Typesense. Kishore Nallan explained the current limitations and provided workarounds and recommendations for each case. The conversation also touched upon the usage of cache in Typesense and the workings of the _eval function.
Resolving Error with Incorrect Field Type during Schema Update
Samuel encountered an error updating the schema for an existing collection. Kishore Nallan suggested specifying a concrete type, and later found inconsistent data within the collection that caused the error.