跟踪“Windows 搜索”查询

发布于 2024-09-07 18:10:23 字数 402 浏览 3 评论 0原文

我可以通过注册表启用 Windows 搜索的日志记录(见下文),但这仅捕获通过 Windows 搜索的默认用户界面发送的查询。我想要捕获 Outlook 2003、Outlook 2007、OneNote 2007 或任何其他访问 SystemIndex 的应用程序使用的查询>。

HKEY_CURRENT_USER\Software\Microsoft\Windows Desktop Search\DS\WriteLog[DWORD]0|1

我想要做的是分析这些查询,以便更好地了解如何为我用来搜索代码库(物理文件系统)的个人搜索实用程序(WinForms/WPF/ADO.NET/OleDb)构建查询。

我如何跟踪在 Windows Search 的 SystemIndex 上执行的所有查询?

I can enable logging for Windows Search through the registry (see below), but this only captures queries sent through the default user-interface for Windows Search. I want to capture queries used by Outlook 2003, Outlook 2007, OneNote 2007 or any other application that accesses the SystemIndex.

HKEY_CURRENT_USER\Software\Microsoft\Windows Desktop Search\DS\WriteLog[DWORD]0|1

What I want to do is analyze these queries in order get a better understanding on how to build queries for my personal search utility (WinForms/WPF/ADO.NET/OleDb) that I use to search my code library (physical file system).

How would I track any and all queries performed on the SystemIndex of Windows Search?

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

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

发布评论

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

评论(3

抠脚大汉 2024-09-14 18:10:23

如果您确实想捕获对 SystemIndex 的所有访问,那将是相当艰巨的任务,因为有 多种方式可以访问它:

如果我们暂时忽略这一点并专注于您的其他目标:

我想要做的是分析这些查询以获得
更好地理解如何构建
对我的个人搜索实用程序的查询

然后我会查看 ISearchQueryHelper接口。

ISearchQueryHelper接口

提供构建查询的方法
根据用户输入,将查询转换为
Windows 搜索 SQL,并获取
连接字符串来初始化
连接到窗口搜索索引。

该接口的一种方法是 GenerateSQLFromUserQuery,它可能会帮助你。

从用户查询生成SQL

生成结构化查询语言 (SQL)
基于客户端提供的查询的查询
以高级形式表示的字符串
查询语法 (AQS) 或自然查询
语法 (NQS)。

If you really want to capture all accesses to the SystemIndex, that would be quite the tall order, as there are multiple ways it can be accessed:

If we ignore that for a bit and focus on your other goal:

What I want to do is analyze these queries in order get a
better understanding on how to build
queries for my personal search utility

Then I would look into the ISearchQueryHelper Interface.

ISearchQueryHelper Interface

Provides methods for building a query
from user input, converting a query to
Windows Search SQL, and obtaining a
connection string to initialize a
connection to the Window Search index.

One method of that interface is GenerateSQLFromUserQuery, which may help you out.

GenerateSQLFromUserQuery

Generates a Structured Query Language (SQL)
query based on a client-supplied query
string expressed in either Advanced
Query Syntax (AQS) or Natural Query
Syntax (NQS).

故人爱我别走 2024-09-14 18:10:23

系统索引作为 OLE DB 源实现。您可以从 ISearchQueryHelper::get_ConnectionString。我一直在寻找一种监视 OLE DB 源的方法,但到目前为止一无所获。

OLE DB 归结为名为 Windows 的可扩展存储引擎 (ESE) 文件。默认情况下,edb 存在于 \All Users\Application Data\Microsoft\Search\Data\Applications\Windows\ 配置文件文件夹中。

所有 ESE 文件均由 ESENT.DLL 管理。可能可以挂接此 DLL 并跟踪查询。可以使用 StraceNTxptruss

经过几个小时的搜索,似乎没有更简单的获取所有 Windows 搜索查询日志的方法。由于学习查询语法是您的目标,因此在其他地方寻找学习辅助工具可能会更简单,例如使用默认的 Windows 搜索 UI 和使用您已经了解的查询日志。尝试使用 ISearchQueryHelper 接口将 ADS 和 NDS 查询转换为 SQL 也可能会有所帮助。

The system index is implemented as an OLE DB source. You can find out the data source from the connection string provided by ISearchQueryHelper::get_ConnectionString. I've been looking for a way to monitor an OLE DB source, but turned up nothing so far.

The OLE DB boils down to the Extensible Storage Engine (ESE) file named Windows.edb that exists, by default, in the \All Users\Application Data\Microsoft\Search\Data\Applications\Windows\ profile folder.

All ESE files are managed by ESENT.DLL. It may be possible to hook this DLL and trace queries. Hooking and logging is possible with programs such as with StraceNT, and xptruss

After a couple of hours searching, there doesn't appear to be any simpler way to get a log of all Windows Search queries. Since learning the query syntax is your goal, it may be simpler to look elsewhere for learning aids, such as using the default Windows Search UI and using the query log that you know about already. It may also be helpful to experiement with converting ADS and NDS queries to SQL using the ISearchQueryHelper interface.

老子叫无熙 2024-09-14 18:10:23

我相信答案就在这里,但还没有时间尝试。

I believe the answer is here, but have not had time to try it out.

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