如何像Outlook一样扩展Windows桌面搜索

How to extend Windows Desktop Search a la Outlook

本文关键字:扩展 一样 Windows 桌面 搜索 何像 Outlook      更新时间:2023-10-16

我想扩展windows桌面搜索,包括来自我的自定义数据存储的结果(就像Outlook那样)。意思是,当有人在Vista或Windows 7的开始菜单中进行搜索时,我希望我的结果显示在"我的自定义类别"中,其中每个结果都是我自定义数据存储中的单个条目。

我读了很多MSDN文档,感觉它们不完整。我还在Windows 7 SDK和Windows Search 3x SDK中使用了一些示例。我希望Windows搜索SDK中的RegSearch示例(这是一个示例协议处理程序实现)将是有用的,然而,它似乎不起作用。我可以构建它并注册它,但是搜索服务返回以下错误(来自事件查看器):

Log Name:      Application
Source:        Microsoft-Windows-Search
Event ID:      3036
Task Category: Gatherer
Level:         Warning
Description:
The content source <reg://<USER SID REMOVED>/> cannot be accessed.
Context:  Application, SystemIndex Catalog
Details:
    The specified address was excluded from the index. The site path rules may have to be modified to include this address.  (HRESULT : 0x80040d07) (0x80040d07)

(注意:我在发布时删除了SID,但日志中包含它)

紧随其后:

Log Name:      Application
Source:        Microsoft-Windows-Search
Event ID:      3023
Task Category: Gatherer
Level:         Warning
Description:
The update cannot be started because all of the content sources were excluded by site path rules, or removed from the index configuration.
Context:  Application, SystemIndex Catalog
Details:
    (HRESULT : 0x1) (0x00000001)

然后:

Log Name:      Application
Source:        Microsoft-Windows-Search
Event ID:      3083
Task Category: Gatherer
Level:         Error
Description:
The protocol handler File cannot be loaded. Error description: (HRESULT : 0x800700c1). 

最后,重复第一个错误。

有人得到这个样本工作吗?协议处理程序方法是我试图完成的正确方法吗?

任何帮助都将非常感激!

下载Windows SDK http://msdn.microsoft.com/en-us/windows/bb980924.aspx,您会发现一些非常好的代码示例—我发现其中一个对于搜索注册表非常有用。

请注意,搜索集成将很好地工作在Vista和更高版本的Windows。理论上,XP也受支持,但这显然是事后才想到的。