Appears to be the query vars when nothing is selected?
“function_ospiti” [“value”]=> int(0)
“function_camere” [“value”]=> int(0)
“function_bagni” [“value”]=> int(0) etc…
I suspect your code isn’t quite robust enough yet to handle such a situation. It requires a sort of exception handling (not a literal programmer’s “exception” though). That can be dealt with later. I suggest first getting proper results when all selections are made.
It’s very difficult to scan for problems when the data is all run together like that. It should be better formatted of you look at the page’s source HTML view (Ctrl/Cmd + U in most browsers). You will then also be able to see everything.
I see you left the var_dump() in place so I can see for myself (or I caught it before you removed it again). When all selections are made, it does appear to be working correctly? In a cursory check it appears all search results fit the criteria I selected. It does fail when no distance to sea is selected. The compare element is still “<=” instead of “EXISTS”. This is the first exception we should address.
This should work:
'compare' => $_GET['function_number'] == '' ? 'EXISTS' : '<=',
It works correctly on my site at least.
The other integer selections (persons, bedrooms, etc.) are probably OK as-is since the comparison is greater than or equal to 0. I think the taxonomy selections are OK as-is as well? Maybe it’s just this distance to sea that’s an issue with no selection.