1

My goal is to obtain result snippets (a.k.a. query-biased summaries) from the Windows Search API (the same thing used by Explorer).

Similar posts:

My focus is on the System.Search.QueryFocusedSummary property (https://msdn.microsoft.com/en-us/library/windows/desktop/bb760171(v=vs.85).aspx), since it's the only (semi-)documented field that should provide what I need. I'm open to a different approach if it is feasible using only .NET (C#) or C++ native code.

I have a working search tool, implemented in C++, that uses the OLE DB API successfully to search the local Windows machine (assuming indexing is enabled) and return results such as System.ItemName, System.MIMEType, System.Size, etc. As expected, I can also obtain the System.Search.AutoSummary field, which is basically just the first N characters of human-readable files (like UNIX head). See this Microsoft page for more.

If I understand correctly, the System.Search.QueryFocusedSummary property is "virtual" in the sense that it is dynamically created by Windows (at some point in time), and not stored in the Index database. Therefore, it is not accessible using the OLE DB approach.

Although Microsoft officially "retired" the Windows API Code Pack, this page (and others linking to it) describes how to use the Windows Search SDK. I followed the Search App example in the de facto Windows API Code Pack repository, and added the QueryFocusedSummary property in place of one of the existing, extracted properties. This had no effect and the property is still empty for all search results.

Does anyone have any insight into how to obtain search snippets from the Windows Search API? I'm concerned only with local client Windows Search.

joe
  • 617
  • 7
  • 22

0 Answers0