title: Getting context around search string in results from Windows Search
body: <p>I have code in my project that uses Windows Search to look through file contents for a string I provide.</p>
  
  <pre><code>SELECT System.ItemName, System.ItemType, System.Search.Rank FROM SYSTEMINDEX 
  WHERE SCOPE='file:C:/NiftyFolder' 
  AND CONTAINS(System.Search.Contents,'"SEARCH STRING"')
  </code></pre>
  
  <p>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.</p>
  
  <p><img src="https://i.stack.imgur.com/zXbHT.jpg" alt="image showing context circled in orange"></p>
  
  <p>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?</p>
  
  <p><strong>Update</strong>:
  After more searching, it looks like it's not available.</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/1879e40f-bbf3-4365-b8f9-e0190ef437b0" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/1879e40f-bbf3-4365-b8f9-e0190ef437b0</a></p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/ddd38a26-30a8-48f5-b053-dcee01094e2b" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/windowsdesktopsearchdevelopment/thread/ddd38a26-30a8-48f5-b053-dcee01094e2b</a></p>
  
  <p><a href="https://stackoverflow.com/questions/8828088/windows-desktop-search-not-returning-queryfocusedsummary">Windows Desktop Search not returning QueryFocusedSummary</a></p>
  
  <p>The closest thing is <strong>System.Search.AutoSummary</strong> but it just returns the first 1000 or so text characters from the  file.</p>