Windows desktop search fails to search inside .SQL files
I've set the index options for the .SQL extension to use "Plain Text filter" with "Index Properties and File Contents" selected, and ensure that the directories containing the SQL files are in the "Included Locations".
Unfortunately, Windows desktop search still fails to find anything in the .SQL files. Other file types such as .cs, .docx etc are searched successfully.
I'm running Windows XP SP2 - and it's a work machine where I can't easily install alternative search engines so I'm stuck with Windows Desktop search for indexed searching.
Obviously I can search the .SQL files using other (non-indexed) techniques, but I prefer the speed of Desktop Search - if I could get it to work.
Update: Having copied a couple of .SQL files to .SQL.TXT files in the same directory as suggested by ~quack, added .SQL.TXT as a file extension to the indexing options (using the plain text filter, with "Index Properties and File Contents" selected) and re-indexing, Desktop Search still fails to find strings in either the .SQL or .SQL.TXT files.
Additional info: after re-indexing, I checked the file types in the Desktop Search advanced options and noted that the .SQL.TXT file extension no longer appears in the list of file types.
Solution 1:
This would obviously be suboptimal, but have you tried copying the .SQL files to .TXT files?
I don't mean simply rename, since you are presumably using the SQL files as SQL files somewhere. But if you have the space, make copies and rename those to .SQL.TXT or so. If your SQL files change frequently, schedule a task to re-create the copies.
This would be worthwhile as an experiment -- if Windows Desktop Search can successfully index a .SQL.TXT file, there's something about the .SQL extension that it's failing on. If it can't, something about the file's format is confusing it.
Solution 2:
This might not be relevant, but for things like this I really like using the command-line. It's really quick and allows you to specify regular expressions and other features like matching the beginning (or end) of a line.
- Hold down shift, and right-click the directory you want to search
- Choose 'Open Command Window Here'
- Type
findstr "order by" *.sql
- If you want to search sub-directories also, just use
findstr /S "order by" *.sql
This will return all files named *.sql with the string "order by" in them. There are lots of command line switches to include things like line numbers, just type findstr /?
Solution 3:
Just use Qytec's free Portable File Seeker instead of Windows Desktop Search. It can successfully search within files with provided extensions. You don't need to install it since it's portable. I tried it on my .SQL files and it works without any problems. Here is a screeny from my PC: