Have you ever used the Windows search facility to look for words embedded in the files and not got back the results that you expected?
I have… all the time…
Most recently I have started development on an existing PHP application (1046 undocumented PHP files). In order to get an understanding of the application I have been searching the source files to find out where certain functionality is utilised…
So I have a PHP class called dbconnection and I want to find all the places that it’s been referenced.
So… browse to the root directory and select Search – All Files and Folders and in the “Word or phrase” box I type dbconnection. Hit the Search button… Nothing… hmm now I don’t know how many files I was expecting, but none is clearly wrong, there is at least one where dbconnection is defined!
To cut a long story short… this is a feature of Windows XP… Microsoft say…
“In Microsoft Windows 2000 and earlier versions of Windows, all files are searched for the content that you specify. Windows XP does not search all file to enhance the performance of searching and to avoid extraneous results. This behavior occurs whether or not you use the Indexing service when you search.”
The solution that worked for me was…
To configure Windows XP to search all files no matter what the file type, obtain the latest service pack for Windows XP and then turn on the Index file types with unknown extensions option.
If you use this method, Windows XP searches all file types for the text that you specify. This can affect the performance of the search functionality.
To do this:
- Click Start, and then click Search (or point to Search, and then click For Files or Folders).
- Click Change preferences, and then click With Indexing Service (for faster local searches).
- Click Change Indexing Service Settings (Advanced). Note that you do not have to turn on the Index service.
- On the toolbar, click Show/Hide Console Tree.
- In the left pane, right-click Indexing Service on Local Machine, and then click Properties.
- On the Generation tab, click to select the Index files with unknown extensions check box, and then click OK.
- Close the Indexing Service console.
This solution and other relating information is available here… http://support.microsoft.com/kb/309173