HTTP Error 500 during search request - CiviCRM 5.1.1
This is a known issue with CiviCRM 5.1.1 that was patched in 5.1.2.   The details of the issue are here: https://github.com/civicrm/civicrm-core/blob/5.1/release-notes/5.1.2.md#synopsis

Download the new version from https://civicrm.org/download and update your site.