#community-help

Typesense Error: Field must be a string

TLDR Aboo encountered an error in Typesense regarding a boolean field. Kishore Nallan suggested checking the schema and made sure the field is defined as boolean.

Powered by Struct AI
raised_hands1
4
3mo
Solved
Join the chat
Jun 20, 2023 (3 months ago)
Aboo
Photo of md5-e18fd6bf1ed8f3adba05f7061edef1e1
Aboo
07:28 AM
Hi
I am new to typesense, working on application using typesense, I am getting below error, can anyone please help on this
//Field xxx must be a string.// as this field is boolean, getting this error while indexing

xxx: true/false

Note: not able to find documentation on this

Thanks in advance
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:31 AM
If you have defined the field as string in schema it must be a string and not boolean in value in the document being indexed.
Aboo
Photo of md5-e18fd6bf1ed8f3adba05f7061edef1e1
Aboo
07:32 AM
Thanks for your response, I have mentioned as boolean only in schema,
Let me check that once again
08:22
Aboo
08:22 AM
Yes you are right, because of nullable boolean field my helper method saved it as 'String', got fixed, thanks for your quick help Kishore Nallan
raised_hands1