Return `MatchNoDocsQuery` if query string is emtpy

Closes #3952