Open focafull opened 2 months ago
I'm assuming
{
"searches": [
{
"q": "*",
"collection": "c",
"query_by": "title",
"filter_by": "$b($a(vendor:[c]))",
"include_fields": "$b(*, $a(*, strategy: nest_array), strategy: nest_array,)",
"exclude_fields": "b_ids, id, $b(a_ids, id, $a(id))"
}
]
}
doesn't fulfill your purpose? It returns:
[
{
"document": {
"b": [
{
"a": [
{
"title": "a9",
"vendor": "c"
}
],
"name": "b1"
},
{
"a": [
{
"title": "a6",
"vendor": "c"
}
],
"name": "b2"
}
],
"title": "c2"
},
"highlight": {},
"highlights": []
},
{
"document": {
"b": {
"a": [
{
"title": "a9",
"vendor": "c"
}
],
"name": "b1"
},
"title": "c1"
},
"highlight": {},
"highlights": []
}
]
Description
When I try to use a left join in a nested join scenario together with a filter, references that don't match the filter will be included as well.
Steps to reproduce
Take these collections
With these example documents
And run a query like this:
Expected Behavior
The documentation states:
"So the result will include the referenced documents if a reference exists otherwise the document will be returned as is."
. In this case I would expect to have all the a documents that don't match the filter not included. Something like this:Actual Behavior
But actually I get these results:
When the filter
vendor:[c]
does not match anya
document all documents from the reference will be included, which is not really helpful.Metadata
Typesense Version: v27.0
OS: Linux