Exclude files with unwanted extensions from search

Add array that contains the unwanted extensions. This array needs more extensions.
Add function that checks if the file should be excluded.
Modify _doSearch to exclude unwanted files.

Addresses #6157