This message was deleted.
# community-help
s
This message was deleted.
k
Doesn't XXX already exist in the schema?
a
Yeah, "XXX" already exists, I was a completely new field.
k
During an alter we do a full schema validation so if there any inconsistencies with any field then that can show up as an error.
a
Ah, okay. Any way to avoid that as of now? Like coerce_or_drop is there for the upsert.
k
Alter doesn't support coercion coercion yet.
You have to fix the data to conform to schema first by reindexing. Or just create new collection with updated schema and index into it.
a
Got it. Thanks! 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?
k
I think the correct fix would be to support coercion. Would you be able to create a small example that showcases the problem and then create a Github issue with that? We do have alter improvements planned in near future and we will prioritize this as part of that.
a
Yeah, sure. Will create the issue.
https://github.com/typesense/typesense/issues/1211 Let me know if you need additional details.
k
One thing I don't understand is if XXX is defined as object how come it's an array on some records.
a
XXX.A.B is an array of strings. 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.
k
It'll be great if you can reproduce this issue on a test collection so you can post the exact schema, sample data and the sequence of api calls that led to this error.
a
Okay. Will try and reproduce it with data as this came up in our collections with 4m+ records and we are still identifying the bad data and how that got it. Once identified I'll update the issue.
k
Thanks
a
Updated the ticket.
k
Thank you 🙏 the x.a is an array in one nested entry but a plain string in another. While this is handled by ingestion but not by validation. Will look into it.
🙌 1