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
For neighborhoods, unit size, and other filter types, we'll want to allow users to select multiple options of the same filter (for example, units with 1 and 2 bedrooms)
Right now the filter system assumes everything should be ANDed together, but queries like this need to be ORed together.
One option is to interpret a param with comma-separated values as a list, and use IN . So a querystring like ?filter[$comparison]=IN&filter[field]=val1,val2,val3 would come in as
{
$comparison: "IN",
field: val1,val2,val3,
}
which would be added to the query with a clause like AND WHERE lower(field) IN [val1, val2, val3]
This doesn't make as much sense if the comparison is something other than `IN but I think that's ok.
Also note the lowercasing of the field, which we'll do to the user provided values as well so the query is case-insensitive.
Also, while we're here, we should update the way the where params are inserted so that we're only inserting allowed strings
The text was updated successfully, but these errors were encountered:
Steps:
For neighborhoods, unit size, and other filter types, we'll want to allow users to select multiple options of the same filter (for example, units with 1 and 2 bedrooms)
Right now the filter system assumes everything should be ANDed together, but queries like this need to be ORed together.
One option is to interpret a param with comma-separated values as a list, and use
IN
. So a querystring like?filter[$comparison]=IN&filter[field]=val1,val2,val3
would come in aswhich would be added to the query with a clause like
AND WHERE lower(field) IN [val1, val2, val3]
This doesn't make as much sense if the comparison is something other than `IN but I think that's ok.
Also note the lowercasing of the field, which we'll do to the user provided values as well so the query is case-insensitive.
Also, while we're here, we should update the way the where params are inserted so that we're only inserting allowed strings
The text was updated successfully, but these errors were encountered: