#community-help

Resolving Typesense Error for Invalid Field Types

TLDR Edward was facing a problem sending documents due to invalid field types. Jason helped to identify and resolve the issued by advising on the correct usage of the schema.

Powered by Struct AI

1

Apr 26, 2022 (20 months ago)
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
08:56 PM
Hi there. I am trying to send a document to a collection but getting an error that the type of object we are sending up is not valid.
Typesense::Error::RequestMalformed (Type of field `exmaple` is invalid.)

I believe that this is because it's an array of arrays but as we are not asking for this to be indexed or faceted, I thought it wouldn't be a problem. We also have an issue with an array of objects... I'm guessing this is the same problem.

Are these data types not accepted at all, or do you think there's an issue with the schema?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
08:58 PM
Edward You should be able to send fields with any data type as long as they're not part of the schema.

Could you share the schema you're using and a sample document?
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
09:00 PM
I will do. I did check that this field wasn't present on the schema but we do have the 'auto' type set? Would that be the cause of it?
09:00
Edward
09:00 PM
Feel like i've answered my own question there
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:00 PM
If you have a field name as .* and type as auto then yes that would be the issue, since all fields will be indexed
09:01
Jason
09:01 PM
You could mark specific fields as unindexed by still adding it to the schema and setting it to index: false

1

Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
09:12 PM
ah. that makes a lot of sense. Thank you for this. Again...
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:13 PM
Happy to help!

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community