IQueriedSearch Excerpt returns odd results.

Vote:
 

When getting Excerpts from a UnifiedSearchFor<string> it seems to have fetched text from Language properties.

The result is a long list of the languages that the fetched page is translated into, which isn't really that useful information for our users.


So my question is how does Excerpt fetch text and is there a way for us to control what text it fetches/displays?

#70406
Apr 18, 2013 14:24
Vote:
 

Hi,

By default the excerpt is fetched from the SearchText field. The default SearchText field is added by including the return value of an extension method named SearchText when indexing pages and blocks. That methods returns a concatenation of all the page's properties that are marked as searchable.

I'm not sure which Language properties you are referring to, but if it's a property that you have in your page type class(es) try marking it with [Searchable(false)].

You can also add a code only property (no setter or with the Ignore attribute) to your page type classes of type string named SearchText and have it return whatever you want in its getter.

Finally, yes, it's possible to change where the excerpt is fetched from but before we go down that route I'd advice trying one of the two options mentioned above :-)

#70412
Apr 18, 2013 15:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.