Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
4.33/5 (3 votes)
See more:
Hello,

I'm trying to read System.Search.QueryFocusedSummary from the SystemIndex.
I get a "column does not exist" error message. I am able to read other
columns such as: System.Search.AutoSummary.
I am using the Microsoft Windows Search 3.x SDK download
(Windows.Search.Interop.dll) on a Windows 7 operating System and Windows
Search 4.0.

My query is:
SELECT TOP 25 System.Search.QueryFocusedSummary From SystemIndex where <br />
CONTAINS('microsoft') ORDER BY System.ItemDate DESC


How can I get the query working 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
                }
            }
        }
    } 

Thanks for any help you can give.
Posted
Updated 23-May-11 5:11am
v3
Comments
milenalukic 21-May-11 11:37am    
Shouldn't your query condition require a column name?

where COLUMN NAME contains
csharpnewbie2 23-May-11 11:10am    
Yes, the column name is System.Search.QueryFocusedSummary. The exception I get is "Column does not exist.".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900