Skip to content

Commit

Permalink
Search: compatibility with PostgreSQL
Browse files Browse the repository at this point in the history
The search query used the comparison operator in a non-standard way, incompatible with PostgreSQL (HTTP error 500 in people/search). PostgreSQL does not do the implicit casting from integer to boolean, you must explicitly write TRUE/FALSE (recommended) or implement explicit casting (not ideal with frequent queries).
  • Loading branch information
LorenzoAncora authored Nov 15, 2018
1 parent 2aa644b commit 04a5c19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Helpers/SearchHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function searchContacts($query, $limitPerPage, $order)
]);
})->paginate($limitPerPage);
} else {
$results = Contact::search($needle, $accountId, $limitPerPage, $order, 'and is_partial=0');
$results = Contact::search($needle, $accountId, $limitPerPage, $order, 'AND is_partial = FALSE');
}

return $results;
Expand Down

0 comments on commit 04a5c19

Please sign in to comment.