Windows Desktop Search not returning QueryFocusedSummary

1k views Asked by At

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?

2

There are 2 answers

3
Yahia On

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 .

1
relpats_eht On

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.