2011-05-20 12 views
6

sql kullanarak Windows Search 4.0'ı sorgulamaya çalışıyorum. Benim için ilgi özelliği: System.Search.QueryFocusedSummary.Windows Search sql - erişemiyor System.Search.QueryFocusedSummary

Bu özelliği SystemIndex'ten okumaya çalışıyorum. Bir "sütun yok" hata iletisi alıyorum. System.Search.AutoSummary gibi diğer sütunları okuyabiliyorum.

Microsoft Windows Search 3.x SDK kullanıyorum (Windows.Search.Interop.dll) bir Windows 7 işletim sistemi ve Windows Arama 4.0.

Benim sorgu:
SELECT TOP 25 System.QueryFocusedSummary From SystemIndex where CONTAINS('microsoft') ORDER BY System.ItemDate DESC

nasıl System.Search.QueryFocusedSummary ile çalışan sorgu alabilirim? oledb arayüzü için kullanılabilir sütunları hakkında bir bağlantı İşte

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. 
      } 
     } 
    } 
} 
+1

Aynı sorunu yaşıyorum, bir çözüm buldunuz mu? – Rocklan

cevap