Windows Search sql - cannot access System.Search.QueryFocusedSummary

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(); //By now it has thrown the exception saying that the column is not found. } } } } 
+6
source share
1 answer

Here is a link about the columns available for the oledb interface:

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

It seems that System.Search.QueryFocusedSummary not showing, and System.Search.AutoSummary is. Maybe that's why you cannot get the column.

+2
source

Source: https://habr.com/ru/post/888638/


All Articles