【发布时间】:2015-01-01 00:29:05
【问题描述】:
我正在尝试使用 sql 查询 Windows Search 4.0。该物业
我感兴趣的是:System.Search.QueryFocusedSummary。
我正在尝试从 SystemIndex 中读取此属性。我收到“列不存在”错误消息。我可以阅读其他专栏,例如:System.Search.AutoSummary。
我正在使用 Microsoft Windows Search 3.x SDK 下载 (Windows.Search.Interop.dll) 在 Windows 7 操作系统和 Windows 搜索 4.0。
我的查询是: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.
}
}
}
}
【问题讨论】:
-
我也遇到了同样的问题,你找到解决办法了吗?