Error 500 when Elasticsearch is enabled, and search by iid
Summary
When Elasticsearch is enabled, and we search by issue/merge request iid causes an internal server error.
Steps to reproduce
- Fill in the search bar:
#123
- Hit enter
Expected behavior
Should list the issue/merge request.
Screenshots
Possible fixes
- Execute this query on Elasticsearch instead of database.
- Fix Gitlab::Elastic:: SearchResults to call
records
, andtotal_count
only when the query is performed against Elasticsearch.