2011-05-20 31 views
6

Estoy intentando consultar el Windows Search 4.0 utilizando sql. La propiedad de interés para mí es: System.Search.QueryFocusedSummary.Windows Search sql: no se puede acceder a System.Search.QueryFocusedSummary

Estoy tratando de leer esta propiedad del SystemIndex. Aparece el mensaje de error "la columna no existe". Puedo leer otras columnas como: System.Search.AutoSummary.

Estoy utilizando el Microsoft Windows Search 3.x SDK descarga (Windows.Search.Interop.dll) en un sistema operativo Windows 7 y Windows Search 4.0.

Mi consulta es:
SELECT TOP 25 System.QueryFocusedSummary From SystemIndex where CONTAINS('microsoft') ORDER BY System.ItemDate DESC

¿Cómo puedo obtener la consulta trabajar con System.Search.QueryFocusedSummary?

El código es el siguiente:

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

Tengo el mismo problema, ¿ha encontrado una solución? – Rocklan

Respuesta

Cuestiones relacionadas