【问题标题】:Windows Search sql - can't access System.Search.QueryFocusedSummaryWindows Search sql - 无法访问 System.Search.QueryFocusedSummary
【发布时间】: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.
            }
        }
    }
} 

【问题讨论】:

  • 我也遇到了同样的问题,你找到解决办法了吗?

标签: c# interop


【解决方案1】:

这里是有关可用于 oledb 接口的列的链接:

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

似乎System.Search.QueryFocusedSummary 没有暴露,而System.Search.AutoSummary 是。也许这就是为什么你不能得到专栏。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 2019-06-08
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多