3

When searching through files indexed using Windows Desktop Search, it would be nice if I could see a snippet of the text within the document that is related to the search text. However when I try to retrieve "System.Search.QueryFocusedSummary" or "System.Search.QueryFocusedSummaryWithFallback " I get a "column name not found" error.

(The code that I am using to query this is shown in this question: Microsoft Desktop Search - CONTAINS not returning results on windows server 2008 )

This is confusing because when you do a search within explorer, you get the snippet of text in your results. So it's possible somehow.

According to this documentation http://msdn.microsoft.com/en-us/library/windows/desktop/bb760171%28v=vs.85%29.aspx it should be retrievable, the same that AutoSummary is.

This question has already been asked on MSDN here:

http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/dcfb40ea-b250-4294-80d0-727c7365745e/

but I'm hoping that the clever stackoverflow people can help me.

As a side note, I'm quite confused as to why this doesn't work, don't lots of people need to index and search documents? Does everyone use Lucene and/or Solr or Windows Search Server instead?

Community
  • 1
  • 1
Rocklan
  • 7,888
  • 3
  • 34
  • 49

2 Answers2

1

A colleague of mine ran into this problem recently. QueryFocusedSummary and QueryFocusedSummaryWithFallback are indeed not accessible via OLEDB. They are, however, accessible via Shell.

In the Windows SDK, there is a sample, $WIN_SDK/Samples/winui/shell/appplatform/ExplorerBrowserSearch, which will get you set up on using Shell functions to perform a search. From here, it should be trivial to add support for QueryFocusedSummary and QueryFocusedSummaryWithFallback via the Shell Property Keys PKEY_Search_QueryFocusedSummary and PKEY_Search_QueryFocusedSummaryWithFallback respectively.

  • I'm trying to implement this in my C# application, and the C++ sample code is hard for me to follow. Can you be more specific about what needs to be done to get the `QueryFocusedSummary`? – anon Dec 31 '14 at 17:22
0

Since you didn't post any code I have to speculate a bit...

I assume you are using OleDB/SQL to execute a query...

Neither QueryFocusedSummary nor QueryFocusedSummaryWithFallback are real columns and thus NOT available via OleDB/SQL !

The only columns available this way are AFAIK

AutoSummary 
Contents 
EntryID 
GatherTime 
Rank 
Store 

QueryFocusedSummary and QueryFocusedSummaryWithFallback are IIRC properties accessiable via COM or a Shell interface .

Yahia
  • 69,653
  • 9
  • 115
  • 144
  • Thanks for your help - There is a link to the code that I am using in the question. Also according to the msdn documentation that I linked to I don't see how autosummary is any different to QueryFocusedSummary. What is an IIRC property? – Rocklan Jan 21 '12 at 13:24
  • @LachlanB IIRC = "If I Remember Correctly"... property is a COM term, whil AutoSummary is Column (accessible via SQL) QueryFocusedSummary is only accessible via COM. check the link I provided, there is a lot of reading material... – Yahia Jan 21 '12 at 13:26
  • @LachlanB The code you link to is using CONTAINS - I might be overlooking something but there is no mention of QueryFocusedSummary in the link... at least it confirms my thinking that you are using SQL... – Yahia Jan 21 '12 at 13:28