Hi, does typescript support nested data? ```[ { ...
# community-help
e
Hi, does typescript support nested data?
Copy code
[
{
    "data": {
        "idFS": "xx",
        "jobNumber": "myjobNumber",
        "applicationUrl": "<https://my_url>",
        "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
    }
}
]
k
👋 Ed, Typesense does not support searching on of nested fields: you have to "flatten" the dict into top-level fields before indexing.
e
can i set the content data to index:false, I don't need to search there, usually that's just for displaying the job
the data in
data
is used for filtering/searching
k
Yeah, that's totally fine. You don't even need to specify the fields in the schema.
e
but i have to flatten it right?
k
If you don't specify a field in the schema, that field is just stored and returned verbatim.
No need to flatten fields that are just part of the document for display. Need to flatten only if you want to search on them.
e
awesome
I use the content just to display the job on the job page, the data is what I can search/filter
k
Then
data
subfields have to be flattened out, like
data.title
,
data.businessUnit
etc. The
content
key can just exist as it is in nested format.
e
Copy code
[
    {
        "idFS": "xx",
        "jobNumber": "myjobNumber",
        "applicationUrl": "<https://my_url>",
        "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
    }
}
]
like so ?
k
👍 yes