Search by 'not equals' ignores null values
Fix filtering in API Demo
-
Search by 'not equals' ignores null values
-
transects(users_id_is_not: "1") funktioniert nicht!
-
Ich wollte das FuzzySearch auf Transekt benutzen mit den Feldern id, name und transectCode.
- @ApiFilter(GenericFieldBasedFilter::class, properties={"fuzzySearch": {"id", "transectCode", "name"}}) Error:
hydra:description": "An exception occurred while executing 'SELECT DISTINCT t0_.id AS id_0, t0_.id AS id_1 FROM \"transect\" t0_ LEFT JOIN user_transect u2_ ON t0_.id = u2_.transect_id LEFT JOIN \"user\" u1_ ON u1_.id = u2_.user_id LEFT JOIN land_coordinator l3_ ON (t0_.icc2 = l3_.icc2) WHERE (LOWER(t0_.id) LIKE ? OR LOWER(t0_.transect_code) LIKE ? OR LOWER(t0_.name) LIKE ?) ORDER BY t0_.id ASC LIMIT 100' with params [\"%code%\", \"%code%\", \"%code%\"]:\n\nSQLSTATE[42883]: Undefined function: 7 ERROR: function lower(integer) does not exist\nLINE 1: ...d_coordinator l3_ ON (t0_.icc2 = l3_.icc2) WHERE (LOWER(t0_....\n ^\nHINT: No function matches the given name and argument types. You might need to add explicit type casts.",
AC
-
searching by operator is_not
includes results that have null values in referenced column (ie. conditionname_is_not: "elvis"
returns also the records where name is null) -
is_not
operator is not crashing with error and it returns expected results when searching by relation.- ManyToMany relations with is_not operator will still behave unexpected. In PropertyHelperTrait, joins will be added for nested entity and records with particular criteria will be eliminated. However, in this example, transect may still appear in the result because there are also other users that are assigned to this transect. There is no quick fix, if this feature is very important - it will be handled in another ticket. Example:
{
transects (users_id_is_not: "2")
{
collection {
id
}
}
}
-
fuzzySearch is working with fields with numeric types
Edited by Michael Voigt