@andrewsbrown currently \OC\Search\Provider\File returns all files. If we just add OC\Search\Result\Audio and OC\Search\Result\Image won't we duplicate results for audio and image files? I don't believe this approach is sufficient because we would have to change \OC\Search\Provider\File and filter out Audio/Image files. Then when somebody works on the Video playback app and implements \OC\Search\Provider\Video how does he filter out those files in the \OC\Search\Provider\File implementation.

Taking a step back I guess \OC\Search\Provider\File is the right provider for all file based results. It should just be possible to limit the results to a certain mimetype to allow searching for specific types like audio or images. The filecache table already stores the mimetype and the mimepart for this. Furthermore, when we want to introduce paging we should allow the clients to supply limit and offset. We can add these as parameters to the new \OC\Search\Provider implementations. Then we can move the above if else block to the legacy OC_Search_Provider_File as a fallback implementation. With that in place we can change the client side code to limit the search results to specific mimetypes, eg in the gallery app we can submit the search query along with mimepart='image' set.

That way apps will be able to only show relevant search results. The files app will show all results and a dashboard app can also use limit and offset ... 

sound like a plan?