R – Is Sharepoint 2003/MOSS 2007 able to return a document snippet containing search terms

full-text-searchmosssharepoint

Is there a search API for getting a short text containing the search terms so that I can use to display to users?

Best Answer

There's properties that can be returned from a search - HitHighlightedSummary & HitHighlightedFields.

If you're building a search in code you can request these in the same way as other fields - they should contain what you're after.

If you take a look at the configuration for the standard results web part, you can see there's an XML property which is the fields requested which includes these by default.