Handling Nested Data and Indexing in Typescript
TLDR Ed asked about handling nested data in Typescript. Kishore Nallan recommended flattening the dictionary for searching, but clarified that fields only used for display don't need to be flattened.
Feb 02, 2022 (21 months ago)
Ed
09:19 AM[
{
"data": {
"idFS": "xx",
"jobNumber": "myjobNumber",
"applicationUrl": "",
"idClient": "11111",
"title": "Sales Development Training Pro",
"language": "EN",
"businessUnit": "my business unit",
"company": "my company",
"city": "Pittsburgh",
"state": "Pennsylvania",
"country": "United States",
"employmentType": "Full-time",
"contract": "Permanent",
"entryLevel": "Experienced professionals",
"jobField": "Sales",
"category": "Construction/mining and trades",
"recruiter": [
"1st recruiter",
"2nd recruiter"
],
"applicationEnd": null,
"postingDate": "2022-01-14T00:00:00+01:00",
"postingDate_timestamp": 1642114800
},
"content": {
"employmentType": "Full-time",
"contract": "Permanent",
"entryLevel": "Experienced professionals",
"jobField": "Sales",
"category": "Construction/mining and trades",
"applicationEnd": null,
"businessHL": "The company",
"business": "",
"taskHL": "What we expect",
"task": "something",
"profileHL": "Who we are looking for",
"profile": "<p>Our Sales Development Training program offers competitive compensation and full benefits</p>",
"offerHL": "<p>Your Benefits With Us</p>",
"offer": "",
"contactHL": "Contact",
"contact": "<p>my contact</p>",
"diversityHL": "Additional information",
"diversity": "<p>some text.</p>",
"headerImage": "/images/header/header_EN.jpg"
},
"_geoloc": {
"lat": 40.5381372,
"lng": -80.0506545
}
}
]
Kishore Nallan
09:21 AMKishore Nallan
09:21 AMEd
09:23 AMEd
09:23 AMdata
is used for filtering/searchingKishore Nallan
09:23 AMEd
09:24 AMKishore Nallan
09:24 AMKishore Nallan
09:24 AMEd
09:24 AMEd
09:25 AMKishore Nallan
09:25 AMdata
subfields have to be flattened out, like data.title
, data.businessUnit
etc. The content
key can just exist as it is in nested format.Ed
09:28 AM[
{
"idFS": "xx",
"jobNumber": "myjobNumber",
"applicationUrl": "",
"idClient": "11111",
"title": "Sales Development Training Pro",
"language": "EN",
"businessUnit": "my business unit",
"company": "my company",
"city": "Pittsburgh",
"state": "Pennsylvania",
"country": "United States",
"employmentType": "Full-time",
"contract": "Permanent",
"entryLevel": "Experienced professionals",
"jobField": "Sales",
"category": "Construction/mining and trades",
"recruiter": [
"1st recruiter",
"2nd recruiter"
],
"applicationEnd": null,
"postingDate": "2022-01-14T00:00:00+01:00",
"postingDate_timestamp": 1642114800
},
"content": {
"employmentType": "Full-time",
"contract": "Permanent",
"entryLevel": "Experienced professionals",
"jobField": "Sales",
"category": "Construction/mining and trades",
"applicationEnd": null,
"businessHL": "The company",
"business": "",
"taskHL": "What we expect",
"task": "something",
"profileHL": "Who we are looking for",
"profile": "<p>Our Sales Development Training program offers competitive compensation and full benefits</p>",
"offerHL": "<p>Your Benefits With Us</p>",
"offer": "",
"contactHL": "Contact",
"contact": "<p>my contact</p>",
"diversityHL": "Additional information",
"diversity": "<p>some text.</p>",
"headerImage": "/images/header/header_EN.jpg"
},
"_geoloc": {
"lat": 40.5381372,
"lng": -80.0506545
}
}
]
Ed
09:29 AMKishore Nallan
09:37 AMTypesense
Indexed 2776 threads (79% resolved)
Similar Threads
Typesense Server Data Structure Issue
Anton had difficulties handling nested fields in Typesense and was seeking advice. Kishore Nallan clarified that Typesense only deals with flat documents, thus no nesting is possible.
Handling Nested Objects in Typesense
Darren queried about storing arrays of objects in Typesense. Kishore Nallan advised that Typesense doesn't support nesting but shared alternative reindexing methods. They added improved nesting support is planned for the future.
Discussing Issues and Improvements for Typesense
Greg shared feedback and raised questions about Typesense, specifically about nested objects, rate limiting, and documentation. Kishore Nallan provided explanations, confirming that non-searchable fields can be stored and noting to improve documentation clarity.
Configuring Typesense Extension for Nested Fields in Firebase Collection
David had issues indexing nested fields using the Typesense extension. Jason offered advice on specifying schemas and prioritizing specific fields, but there remained unresolved challenges with the schema.
Discussing Support for Nested Objects in Typesense
Martin expressed the need for support for nested objects in Typesense. Kishore Nallan mentioned the possibility of flattening objects before indexing and restoring them later. An issue has been created on GitHub to track this.