Windows 7 联合搜索 - 如何让它向我的 .net 程序集发送搜索请求

发布于 2024-08-23 17:27:54 字数 1618 浏览 9 评论 0原文

我试图通过本地 .net 程序集的联合搜索功能在 Windows 7 资源管理器中显示搜索结果。 (不是来自网络服务)

我找到了各种教程,但它们都是针对网络服务的。早些时候我认为这是不可能的,但后来我遇到了 StickyNotes 联合搜索连接器。 .OSDX 文件的内容是:

<?xml version="1.0" encoding="UTF-8"?>
<searchConnectorDescription xmlns="http://schemas.microsoft.com/windows/2009/searchConnector">
  <description>Create short handwritten or text notes.</description>
  <isSearchOnlyItem>true</isSearchOnlyItem>
  <includeInStartMenuScope>true</includeInStartMenuScope>
  <templateInfo>
    <folderType>{982725EE-6F47-479E-B447-812BFA7D2E8F}</folderType>
  </templateInfo>
  <simpleLocation>
    <url>StickyNotes://{S-1-5-21-3431700657-2522803235-1547684158-1000}/notes</url>
    <serialized>MBAAAEAFCAAAAAAAADAAAAAAAYUgAAQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAYKAUAwHAykg1PPWtiyRvmVorPeOnkJkAQEATBAdAkGAjBwaAkHAOBwbAQHAlBwcAoDAvAwLAsHATBQLAEDAtAQNA0CAyAQMA0CAzAANAMDAxAwNAADAwAgNAUDA3AQLAIDA1AgMAIDA4AAMAMDAyAwMAUDAtAQMAUDA0AwNAYDA4AANAEDA1AAOA0CAxAAMAADAwAQfA8CAuBwbAQHAlBwcAAAAAAAAAAAAAAA</serialized>
  </simpleLocation>
</searchConnectorDescription>

这意味着可以将搜索查询转发到本地数据存储/dll/exe

我想使用我的 .net 应用程序以相同/相似的方式提供搜索结果。我从哪里开始?

请参阅:Windows 7 联合搜索提供程序实施者指南

我的目标是使文档库数据库 (sqlite) 可通过 Windows 资源管理器进行搜索,并列出来自数据库的文件及其元数据资源管理器(文件存储在本地)。

I am trying to display search results in the windows 7 explorer thru the federated search feature, from a local .net assembly. (not from a web service)

I have found various tutorials, but all of them are for web services. Earlier I thought that it was not possible but then, I came across the StickyNotes federated search connector. The contents of the .OSDX file are:

<?xml version="1.0" encoding="UTF-8"?>
<searchConnectorDescription xmlns="http://schemas.microsoft.com/windows/2009/searchConnector">
  <description>Create short handwritten or text notes.</description>
  <isSearchOnlyItem>true</isSearchOnlyItem>
  <includeInStartMenuScope>true</includeInStartMenuScope>
  <templateInfo>
    <folderType>{982725EE-6F47-479E-B447-812BFA7D2E8F}</folderType>
  </templateInfo>
  <simpleLocation>
    <url>StickyNotes://{S-1-5-21-3431700657-2522803235-1547684158-1000}/notes</url>
    <serialized>MBAAAEAFCAAAAAAAADAAAAAAAYUgAAQBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAYKAUAwHAykg1PPWtiyRvmVorPeOnkJkAQEATBAdAkGAjBwaAkHAOBwbAQHAlBwcAoDAvAwLAsHATBQLAEDAtAQNA0CAyAQMA0CAzAANAMDAxAwNAADAwAgNAUDA3AQLAIDA1AgMAIDA4AAMAMDAyAwMAUDAtAQMAUDA0AwNAYDA4AANAEDA1AAOA0CAxAAMAADAwAQfA8CAuBwbAQHAlBwcAAAAAAAAAAAAAAA</serialized>
  </simpleLocation>
</searchConnectorDescription>

This means that it is possible to forward a search query to a local datastore/dll/exe

I would like to use my .net app to provide search results in the same/similar way. Where do I start?

See: Windows 7 Federated Search Provider Implementer’s Guide

My aim is to make a documents library database (sqlite) searchable via the windows explorer and list the files and their meta data from the DB in explorer (files are stored locally).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魂ガ小子 2024-08-30 17:27:54

该项目似乎是在 C# 中实现此目的:http://mossph.codeplex.com/

该项目使用IContentEnumerator、IFilter 和 IUrlAccessor。一切都从 ContentEnumerator 类的实现传播。

This project appears to accomplish this in C#: http://mossph.codeplex.com/

The project implements ISearchProtocol using IContentEnumerator, IFilter and IUrlAccessor. Everything propogates from an implement of a ContentEnumerator class.

薄凉少年不暖心 2024-08-30 17:27:54

MSDN上的信息已更新。
http://msdn.microsoft.com/en -us/library/dd378288%28v=vs.85%29.aspx

现在列出:

HRESULT GetResults(
  [in]   HWND hwnd,
  [in]   LPCWSTR pszQuery,
  [in]   DWORD dwStartIndex,
  [in]   DWORD dwCount,
  [in]   REFIID riid,
  [out]  void **ppv
);

参数

hwnd [in]

类型:HWND
调用者的窗口句柄。

psz查询 [输入]

类型:LPCWSTR
用户输入的查询。此参数相当于 OpenSearch {searchTerms} 参数,并且可以为空。

dwStartIndex [输入]

类型:DWORD
所请求的第一个结果的索引。相当于 OpenSearch {startIndex} 参数。请参阅下面的备注。

dwCount [输入]

类型:DWORD
请求的结果数。相当于 OpenSearch {count} 参数。

里德 [中]

类型:REFIID
正在请求的接口的 IID。通常是 IID_IStream。

ppv [出]

类型:无效**
接口指针,其类型由 RIID 指定,指向包含 Atom 或 RSS 格式结果的对象。

至少我们知道有效的 riid 是 IID_IStream

相关信息如下:http://msdn.microsoft.com/en-us/library/windows/desktop/aa380034%28v=vs.85%29.aspx

The info on MSDN has been updated.
http://msdn.microsoft.com/en-us/library/dd378288%28v=vs.85%29.aspx

It now lists:

HRESULT GetResults(
  [in]   HWND hwnd,
  [in]   LPCWSTR pszQuery,
  [in]   DWORD dwStartIndex,
  [in]   DWORD dwCount,
  [in]   REFIID riid,
  [out]  void **ppv
);

Parameters

hwnd [in]

Type: HWND
The window handle of the caller.

pszQuery [in]

Type: LPCWSTR
The query as entered by the user. This parameter is equivalent to the OpenSearch {searchTerms} parameter and may be empty.

dwStartIndex [in]

Type: DWORD
The index of the first result being requested. Equivalent to the OpenSearch {startIndex} parameter. See Remarks below.

dwCount [in]

Type: DWORD
The number of results being requested. Equivalent to the OpenSearch {count} parameter.

riid [in]

Type: REFIID
The IID of the interface being requested. Typically IID_IStream.

ppv [out]

Type: void**
An interface pointer, of type specified by RIID, to the object containing the results in Atom or RSS format.

At least we know that a valid riid is IID_IStream

The info for that is here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa380034%28v=vs.85%29.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文