Akuma Isaac
07/02/2024, 7:46 PM// splits_development
{
"name": "splits_development",
"enable_nested_fields": true,
"fields": [
{ "name": "id", "type": "string" },
{ "name": "name", "type": "string" },
{ "name": "description", "type": "string" },
{ "name": "category", "type": "string", "facet": true },
{ "name": "created_at", "type": "int64" },
{ "name": "is_active", "type": "bool", "facet": true },
{ "name": "is_approved", "type": "bool", "facet": true },
{ "name": "available_slots", "type": "int64", "facet": true },
{ "name": "community_id", "type": "string", "facet": true, "reference": "communities_development.id" },
{ "name": "members", "type": "string[]", "reference": "split_members_development.user_id" }
]
}
// split_members_development
{
"name": "split_members_development",
"enable_nested_fields": true,
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "split_id",
"type": "string",
"facet": true,
"reference": "splits_development.id"
},
{
"name": "user_id",
"type": "string",
"facet": true
},
{
"name": "is_admin",
"type": "bool",
"facet": true
},
{
"name": "created_at",
"type": "int64"
}
]
}
and search query
{
"q": "*",
"collection": "splits_development",
"limit": 250,
"filter_by": "$communities_development(address.country_code:=NG && type:[SPLIT_BUY, SPLIT_SHARE])",
"sort_by": "$split_members_development(created_at:desc)",
"include_fields": "id,$split_members_development(*)"
}
but I am getting this error
Invalid Format: Request failed with HTTP code 400 | Server said: Could not find `members_sequence_id` in sort_index.
it all started when I added members
string[] field based on this https://github.com/typesense/typesense/issues/1803#issuecomment-2202594646