Search does not work for imported files

Looks related to the following bug.