Getting context around search string in results from Windows Search

天涯浪子 提交于 2019-12-22 09:27:00

问题


I have code in my project that uses Windows Search to look through file contents for a string I provide.

SELECT System.ItemName, System.ItemType, System.Search.Rank FROM SYSTEMINDEX 
WHERE SCOPE='file:C:/NiftyFolder' 
AND CONTAINS(System.Search.Contents,'"SEARCH STRING"')

I get the proper search results but I'd like to go a step further and get the context around my search string. I'm showing the search results on a webpage and ideally, I'd like something similar to what you get in Windows when you have the proper iFilters installed.

I've got the file type, path, and name but is there a System.??? that will get the text that's circled in orange in the image above?

Update: After more searching, it looks like it's not available.

http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/1879e40f-bbf3-4365-b8f9-e0190ef437b0

http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/ddd38a26-30a8-48f5-b053-dcee01094e2b

Windows Desktop Search not returning QueryFocusedSummary

The closest thing is System.Search.AutoSummary but it just returns the first 1000 or so text characters from the file.

来源:https://stackoverflow.com/questions/9285099/getting-context-around-search-string-in-results-from-windows-search

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