Windows Desktop Search not returning QueryFocusedSummary

隐身守侯 提交于 2019-12-01 06:11:08

问题


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?


回答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.




回答2:


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 .



来源:https://stackoverflow.com/questions/8828088/windows-desktop-search-not-returning-queryfocusedsummary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!