跟踪“Windows 搜索”查询
我可以通过注册表启用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您确实想捕获对 SystemIndex 的所有访问,那将是相当艰巨的任务,因为有 多种方式可以访问它:
索引
ISearchQueryHelper
协议
搜索 SQL 语法
以编程方式
如果我们暂时忽略这一点并专注于您的其他目标:
然后我会查看 ISearchQueryHelper接口。
该接口的一种方法是 GenerateSQLFromUserQuery,它可能会帮助你。
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:
the Index
ISearchQueryHelper
Protocol
Search SQL Syntax
Programmatically
If we ignore that for a bit and focus on your other goal:
Then I would look into the ISearchQueryHelper Interface.
One method of that interface is GenerateSQLFromUserQuery, which may help you out.
系统索引作为 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 并跟踪查询。可以使用 StraceNT 和 xptruss
经过几个小时的搜索,似乎没有更简单的获取所有 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.我相信答案就在这里,但还没有时间尝试。
http://msdn.microsoft.com/en-us/ library/ms693114(VS.85).aspx
http://msdn.microsoft.com/en-us/library/cc765421.aspx
I believe the answer is here, but have not had time to try it out.
http://msdn.microsoft.com/en-us/library/ms693114(VS.85).aspx
http://msdn.microsoft.com/en-us/library/cc765421.aspx