Programming Desktop Search
Although you may not be interested in customizing an open-source desktop search tool, you may be interested in extending one of the more popular tools, such as Google Desktop. For this reason, most desktop search providers include an API that allows you to extend their tools. Most of the tools let you at least add new content-type filters. This enables you to extend the tools to index and search content for your own custom applications.
However, some of the tools, such as Google Desktop and Windows Desktop, go further. Google, for example, lets you hook various indexing and search events. Both Google Desktop and Windows Desktop Search allow you to integrate their index and search engines right into your own applications. Let's take a look at the APIs available from the desktop search tool providers and examine the capabilities in each.
Beagle API
The Beagle API contains two main types of components you can develop to extend the indexation and query capabilities of Beagle. These components are called Beagle Filters and Beagle Backend components.
Beagle Filters are components that extract pertinent information from an item to be indexed (such as an e-mail or an OpenOffice document). Filter components rely on Beagle Backend components to retrieve data items and stream the indexable content to them.
Beagle Backend components can be divided into two subtypes. Indexable components have programmed-in knowledge of how to locate specific data items for indexing and inform the Beagle engine of items available to be indexed. Queryable components know how to query other data sources at search time that aren't feasible to be indexed themselves. For instance, there is a Google backend component that queries Google and returns the results to the Beagle engine.
Windows Desktop Search Interfaces and SDK
Microsoft lets you enhance its desktop search tool to add support for new file types to be indexed, add new data sources to locate content to be indexed or searched, and integrate desktop search results into other applications. For instance, a human resources application can be extended to display em-ployee information from a corporate database, as well as information about that employee from a representative's local hard drive or some other private store.
Windows Desktop Search components are built as COM objects that implement specific interfaces. For instance, to add support for a new file type, your component must implement the IFilter
interface. The result is a component that knows how to extract the searchable information from the file type in question, can be invoked by the desktop search engine and can be integrated with Windows Explorer.
Here's a complete list of COM interfaces and their function:
-
IFilter
-
IUrlAccessor
provides information about a resource and its URL. -
ISearchProtocol
maps a resource to anIUrlAccessor
and uses a specific protocol to access the data. -
IContextMenu
defines how the URL is to be displayed in a context menu. -
IExtractIcon
defines an icon to associate with a URL. -
IShellFolder
provides references to the implementation of theIContextMenu
andIExtractIcon
interfaces. -
IPersistFolder
initializes shell folder objects.