Windows搜索sql – 无法访问System.Search.QueryFocusedSummary

我正在尝试使用sql查询Windows Search 4.0。 我感兴趣的属性是: System.Search.QueryFocusedSummary

我正在尝试从SystemIndex读取此属性。 我收到“列不存在”错误消息。 我能够读取其他列,例如: System.Search.AutoSummary

我在Windows 7操作系统和Windows Search 4.0上使用Microsoft Windows Search 3.x SDK下载(Windows.Search.Interop.dll)。

我的查询是:
SELECT TOP 25 System.QueryFocusedSummary From SystemIndex where CONTAINS('microsoft') ORDER BY System.ItemDate DESC

如何使用System.Search.QueryFocusedSummary进行查询?

代码如下:

 using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Data.OleDb; using System.IO; using System.Security.Permissions; using System.Text; using Microsoft.Search.Interop; namespace QueryFocusedSummaryTest { class Program [Stathread] static void Main(string[] args) { string sqlQuery = "select top 25 System.Search.QueryFocusedSummary from SystemIndex where contains('microsoft') order by System.ItemDate DESC"; CSearchManager manager = new CSearchManager(); ISearchCtalogManager catalogMaager = manager.GetCatalog("SystemIndex"); ISearchQueryHelper queryHelper = catalogManager.GetQueryHelper(); using (System.Data.OleDb.OleDbConnection conn = new OleDbConnection(queryHelper.ConnectionString)) { conn.Open(); using (OleDbCommand command = new OleDbCommand(sqlQuery, conn)) { OleDbDataAdapter ds = new OleDbDataAdapter(command); DataSet ds = new DataSet(); ds.Fill(ds); command.ExecuteNonQuery(); //By now it has thrown the exception saying that the column is not found. } } } } 

以下是有关oledb界面可用列的链接:

https://web.archive.org/web/20120615190325/http://www.ariankulp.com/downloads/WindowsShellOLEProperties.txt

似乎没有公开System.Search.AutoSummary ,而System.Search.AutoSummary是。 也许这就是你无法获得专栏的原因。