You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using FreeTextQueryFilter together with OrFilter(new PartialSearchFilter()), nested relational properties are joined with INNER JOIN.
This becomes a problem when one of these relations is nullable.
Because of the INNER JOIN, root resources are excluded from the result set before the OR conditions are evaluated. As a result, an entity can fail to match even if one of its direct scalar fields does match the search term.
Some relations such as service, department, or job are nullable.
Example data:
User A:
name = "John Doe"
service = null
User B:
name = "Other User"
service.name = "IT"
Request
GET /users?search=john
Actual behavior
User A is not returned, even though name matches "john".
This appears to happen because nested properties like service.name are joined using INNER JOIN, so users with service = null are removed from the query result before the OR expression is applied.
Expected behavior
For nullable relations, nested properties used by text search should not exclude the root entity when the relation is null.
In this case, we would expect a LEFT JOIN so that:
name LIKE '%john%'
OR internalPhone LIKE ...
OR externalPhone LIKE ...
OR service.name LIKE ...
etc.
can still match on direct fields even if a nullable relation is absent.
Activity
fix(doctrine): left join nested props in OrFilter (#8674)