[WIP] Fix searching on empty project

#### What does this MR do?

This PR fixes searching on empty projects.

#### Why was this MR needed?

Currently searching on an empty project raises a 500 error. 

#### What are the relevant issue numbers / Feature requests?

This PR fixes

* #7217
* #6776

### TODO
* [ ] Better styling if there is no search result
* [ ] Extend notice message if there is no search result to issues