Creating JSON Collection with Object Array
TLDR suraj asked how to create a JSON collection with an object array. Kishore Nallan advised adding addresses and letting internal fields be auto-detected.
Apr 06, 2023 (5 months ago)
suraj
04:23 AM{
"name":"abc",
"addresses":[{
"pincode":123,
"street":"abc",
"type":"home"
},{
"pincode":123,
"street":"abc",
"type":"office"
}
]
}
suraj
04:26 AMsuraj
04:26 AMfields.add(new Field().name("addresses.pincode").type(FieldTypes.STRING));
Kishore Nallan
05:38 AMsuraj
05:57 AMsuraj
05:57 AMField().name("addresses").type(FieldTypes.OBJECT_ARRAY));
Kishore Nallan
05:59 AMsuraj
06:03 AMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Fixing "bad json" error in Typesense 0.24
Adam experiences "bad json" error when creating collections in Typesense 0.24. Jason identifies a typo in the docs causing the error and helps troubleshoot additional errors.



Discussions on Typesense, Collections, and Dynamic Fields
Tugay shares plans to use Typesense for their SaaS platform and asks about collection sizes and sharding. Jason clarifies Typesense's capabilities and shares a beta feature. They discuss using unique collections per customer and new improvements. Kishore Nallan and Gabe comment on threading and data protection respectively.


Using Typesense to Query by Custom Column Key Value
Sandip asked how to use Typesense to perform unique key searches in different organizations. Kishore Nallan suggested creating an 'object' field for varying keys. After a clarification, Sandip expressed satisfaction with the advice.
Resolving Special Character Search Errors
suraj had issues searching for data containing special characters. Kishore Nallan resolved the issue by advising suraj to remove the parameters for 'preSegmentedQuery' and 'tokenSeparators'.

Updating Collections Strategy and Faceting New Field
Nithin asked about strategies for updating collections and faceting new fields. Kishore Nallan suggested creating another collection, indexing in the background and using aliases to switch live traffic over, and shared details about the upcoming release.