Gauthier PLM
08/20/2025, 9:08 AMthematics.label
, but since I provide the whole object and not the index, it does not seem to be properly indexed.
I have done a similar thing on another object, where instead of being optional, the field is mandatory, and typesense did not accept the data, complaining that <field>.label
is missing.
this is the company I have:
{
name: "companies",
fields: [
{
name: "id",
type: "string",
index: false,
},
{
name: "name",
type: "string",
infix: true,
stem: true,
},
{
name: "logo_id",
type: "string",
optional: true,
index: false,
},
{
name: "thematics.label",
type: "string[]",
facet: true,
optional: true,
},
{
name: "segments.label",
type: "string[]",
facet: true,
optional: true,
},
{
name: "location",
type: "string",
facet: true,
optional: true,
},
{
name: "ownership",
type: "string",
facet: true,
optional: true,
},
{
name: "restricted_users",
type: "string[]",
optional: true,
},
],
enable_nested_fields: false,
}
And a payload example:
[
{
"id": "019685f4-cabb-a16e-c35d-c61f153767bf",
"name": "Atlantica Digital",
"logo_id": "companies/rec3SnmvjJJRERSIw",
"thematics": [{"id": 1330, "type": "THEMATIC_V2", "label": "Professional & IT services", "order": "c0AW"}, {"id": 1333, "type": "THEMATIC_V2", "label": "Niche Verticals", "order": "c0AZ"}, {"id": 1338, "type": "THEMATIC_V2", "label": "Cybersecurity", "order": "c0Ae"}],
"segments": [{"id": 1461, "type": "SEGMENT_V2", "label": "System Integrator", "order": "c0B0"}, {"id": 1487, "type": "SEGMENT_V2", "label": "Telecommunication", "order": "c0BQ"}],
"location": "Italy",
"ownership": "PE Owned",
"restricted_users": null
}
]
Fanis Tharropoulos
08/20/2025, 11:32 AMenable_nested_fields
has to be set to true in order to have a nested object structureGauthier PLM
08/20/2025, 12:06 PM