[Feature Request] Add support for faceting on joined reference fields
Description
Consider the following schemas:
{
"name": "books",
"fields": [
{"name": "title", "type": "string"},
{"name": "author_id", "type": "string", "reference": "authors.id"}
]
}
{
"name": "authors",
"fields": [
{"name": "id", "type": "string"},
{"name": "name", "type": "string"}
]
}
I'd like to request a facet for the field "name" of the referenced collection "authors"
{
"collection": "books",
"include_fields": "$authors(name)",
"q": "famous"
"facet_by": "$authors(name)"
}
Expected Behavior
Return the results with a facet for the field "authors.name"
Actual Behavior
{
"message": "Could not find a facet field named `$authors` in the schema."
}
Metadata
Typesense Version: 26
OS: any
I'd like to add the importance of this feature. I was about to change my data model to use the new JOIN feature of the Typesense 26. This would save us a huge amount of indexing time and data storage. Now I have to wait until this feature is released, because we need faceting working for referenced collections :(
Adding support for JOINs was immense new feature, but still incomplete without the proper faceting support.
Any plans to implement this soon? I think it's really important feature. We can't practically use joins without it.
Stumbled upon this issue while trying to implement facets functionality on the joins. Would love to see this feature in Typesense.
Definitely important to us in our implementation
Hi,
Since this issue hasn't appeared on the public roadmap yet, should we assume it will take a long time before it's implemented?
We are experiencing a similar issue in our implementation.
We have two collections:
product price We separate the price collection because a single product can have multiple prices based on member types. This also helps reduce indexing complexity, as updates to products and prices happen in different scenarios. Additionally, we want to minimize vector indexing in the product collection when we implement vector search later on, so price updates don't require reindexing the product.
We encountered this issue when trying to get the min, max, and average price values based on a query in the product collection.
An alternative solution could be querying the price collection and filtering by the product collection, but this feature is also not implemented and also not yet appeared on the public roadmap yet, as mentioned in #1657.