Koushik Sarkar
08/06/2025, 2:18 PM{
"results": [
{
"facet_counts": [],
"found": 1,
"hits": [
{
"document": {
"_last_modified_at": 1753537819479,
"description": "A blackout forces a young writer to face her crippling fear of the dark as she realizes that an evil is lurking inside her home.",
"duration": 420,
"genres": [
"Horror",
"Thriller"
],
"quality": [
"HD"
],
"ratings": [
{
"rating": "TV-G",
"source": "alt-tv-rating"
},
{
"rating": "G",
"source": "mpaa"
}
],
"release_year": 2017,
"type": "short",
"writer": []
},
"highlight": {},
"highlights": []
}
],
"out_of": 19,
"page": 1,
"request_params": {
"collection_name": "titles",
"first_q": "*",
"per_page": 10,
"q": "*"
},
"search_cutoff": false,
"search_time_ms": 1
}
]
}
How we can use filter_by query to search "ratings->source" and "ratings->rating" ?
I used below but looks its not enough
{
"searches": [
{
"q": "*",
"query_by": "",
"filter_by": "ratings.{rating:=G && source:=mpaa}",
"sort_by": "",
"exclude_fields": ""
}
]
}
Returning below response,
{
"results": [
{
"code": 400,
"error": "Could not find a filter field named `ratings.{rating` in the schema."
}
]
}
Fanis Tharropoulos
08/06/2025, 3:00 PMKoushik Sarkar
08/07/2025, 10:57 AMKoushik Sarkar
08/07/2025, 3:36 PMFanis Tharropoulos
08/07/2025, 3:37 PMKoushik Sarkar
08/11/2025, 6:56 AMKoushik Sarkar
08/11/2025, 7:27 AMcurl -X GET <http://localhost:8108/debug>
{"state":1,"version":"29.0"}
Request Body :
{
"searches": [
{
"q": "*",
"query_by": "",
"filter_by": "ratings.{source:=mpaa}",
"sort_by": "",
"exclude_fields": "description_embedding,tags_embedding"
}
]
}
Same Error :
{
"results": [
{
"code": 400,
"error": "Could not find a filter field named `ratings.source` in the schema."
}
]
}
Fanis Tharropoulos
08/11/2025, 9:05 AMKoushik Sarkar
08/11/2025, 2:55 PMhttp://{{TYPESENSE_SERVER}}:{{TYPESENSE_PORT}}/multi_search?collection=titles_20250804
Body :
{
"searches": [
{
"q": "*",
"query_by": "",
"filter_by": "ratings.{source:=mpaa}",
"sort_by": "",
"exclude_fields": "description_embedding,tags_embedding"
}
]
}
Koushik Sarkar
08/14/2025, 11:44 AM