I am trying to query Windows Search 4.0 using sql. Real estate is of interest to me: System.Search.QueryFocusedSummary .
I am trying to read this property from SystemIndex. I get the error "column not exist". I can read other columns, such as: System.Search.AutoSummary .
I use the Microsoft Windows Search 3.x SDK to download (Windows.Search.Interop.dll) on the Windows 7 and Windows Search 4.0 operating system.
My request:
SELECT TOP 25 System.QueryFocusedSummary From SystemIndex where CONTAINS('microsoft') ORDER BY System.ItemDate DESC
How can I make a query work with System.Search.QueryFocusedSummary ?
The code is as follows:
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();
source share