HitSpecification - Logic used for constructing the excerpt text

Vote:
 

Im a little confused about how the HitSpecification chooses which properties to use for building the excerpt text for a result.

I have created a custom projection for the excerpt text from for the pages on my site:

            SearchClient.Instance.Conventions.UnifiedSearchRegistry
                .ForInstanceOf<SitePageBase>()
                .ProjectExcerptUsing<SitePageBase>(spec =>
                            x => x.TeaserText);

This correctly displays teaser text when available on the page, however it seems when the teaser text is not long enough to fill the ExcerptLength defined on the HitSpecification, it will get text from other properties on the page to makeup the length.

I would like to either:

  1. Insutrct the HitSpecification to not use any other properties other than the one defined in the projection (even if it falls short in length)
  2. or.. Define the fallback properties to use in the event the teaser text falls short? (i.e MainBody)

 

 

 

#72445
Jun 17, 2013 16:27
Vote:
 

Your snippet looks correct and should work as expected (your excerpt should only contain TeserText). I've not been able to recreate the issue. Can you post the exact query you are performing? 

#72522
Jun 19, 2013 14:17
* 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.