I am trying to develop a customized SharePoint 2010 web part for FAST search. I am using Microsoft.Office.Server.Search.Query.KeywordQuery
something like this:
var FASTquery = new KeywordQuery(proxy)
{
ResultsProvider = SearchProvider.FASTSearch,
QueryText = queryText,
ResultTypes = ResultType.RelevantResults | ResultType.RefinementResults
};
FASTquery.SelectProperties.AddRange(
new string[] { "Title", /* ..., */ "HitHighlightedSummary" });
ResultTableCollection searchResults = FASTquery.Execute();
I go on to bind searchResults[ResultType.RelevantResults]
to a Repeater
control. I'm trying to get the "hit highlighted summary" to appear by calling FASTquery.HighlightStringValue()
. The value I'm passing is the HitHighlightedSummary
from searchResults
. An example of what this looks like for a result when searching for "ear" is:
<ddd/>FALSE ); GetDlgItem(IDC_<c0>EAR</c0>_PAIN_STATIC)->EnableWindow<ddd/>FALSE ); GetDlgIte(IDC_<c0>EAR</c0>_PAIN_ABSENT_RADIO<ddd/>FALSE ); GetDlgItem(IDC_<c0>EAR</c0>_PAIN_MILD_RADIO<ddd/>
However, when called with a string like this, FASTquery.HighlightStringValue()
is throwing a System.ServiceModel.FaultException
with the message "Value does not fall within the expected range."
What is the correct way to convert this excerpt to HTML, or should I be calling HighlightStringValue()
with some other value? The documentation is not particularly helpful.