Adding Data to the Index
Microsoft Windows Search can be extended to index the contents of new file types and data stores. Currently, Windows Search supports over 200 types of items (including plaintext items such as HTML, XML, and source code files) and uses IFilter and protocol handler technology similar to SharePoint Services. If you already have filter implementations installed for your new file types, Windows Search can use the existing filter interfaces to index this data.
Windows Search add-ins enable the index to traverse and parse new data and data structures for information to add to the searchable catalog. These add-ins can also extend the Windows Shell to associate icons and context-menu handlers with the new file types and data stores. To include new file types in the Windows Search catalog, an add-in must implement the IFilter and IPropertyStore interfaces. To include new data stores, an add-in must be a protocol handler. If the new data store includes embedded files or new file types itself, you will also need to write an appropriate filter as well.
Filters, property handlers and protocol handlers must be written in native code due to potential CLR versioning issues with the process that multiple add-ins run in.
Add-ins can extend Windows Search to index new or proprietary file types and to associate each new file type with a file-specific icon or context menu. To do this, you can build and register filters to access the contents of the new file type and property handlers to access the properties. These add-ins:
- Implement an IFilter interface for each file type so Windows Search can access and index the file type's content.
- Implement an IPropertyStore interface for each file type so Windows Search can access and index the file type's properties.
- Implement the IExtractIcon and IContextMenu interfaces to add icons and context menus for greater integration and usability.
For a discussion on implementing filters, see Developing Filters for Windows Search.
For a discussion on implementing property handlers, see Developing Property Handlers for Windows Search.
Add-ins can extend Windows Search to index new data stores and to associate files with a file-specific icon or context menu. To do this, you can build and register a protocol handler that:
- Implements the ISearchProtocol and IUrlAccessor interfaces to process and bind individual items in the content source. Windows Search uses URLs to uniquely identify items, whether those items are in the file system, inside a database-like store, or on the Web.
- Implements the IPersistFolder interface and portions of the IShellFolder interface to add icons and context menus for greater integration and usability.
For a discussion on implementing protocol handlers, see Developing Protocol Handler Add-ins.
Installation of an add-in should follow the following guidelines:
- The installer must use either EXE or MSI installer.
- Release notes must be provided.
- An Add/Remove Programs entry must be created for each add-in installed.
- The installer must take over all registry settings for the particular file type or store that the current add-in understands.
- If a previous add-in is being overwritten, the installer should notify the user.
- If a newer add-in has overwritten the previous add-in, there should be the ability to restore the previous add-in's functionality and make it the default add-in for that file type or store again.