Windows Search sql - 无法访问 System.Search.QueryFocusedSummary

本文关键字:Search 访问 System QueryFocusedSummary sql Windows | 更新日期: 2023-09-27 17:57:11

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

我正在尝试从系统索引中读取此属性。我收到"列不存在"错误消息。我能够阅读其他列,例如: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.
            }
        }
    }
} 

Windows Search sql - 无法访问 System.Search.QueryFocusedSummary

以下是有关可用于 oledb 接口的列的链接:

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

似乎System.Search.QueryFocusedSummary没有暴露,而System.Search.AutoSummary暴露了。也许这就是您无法获得该列的原因。