Try our conversational search powered by Generative AI!

Not showing searchable fields

Vote:
 

I'm trying to have a field that is indexed and put in the EPiServer Search index, but isn't included in the EPISERVER_SEARCH_DISPLAYTEXT. This is because the field stores the meta keywords and description, and we do like to use them to search, but they're showing up at the beginning of the displaytext field.

How can I make a piece of text indexed, but not stored in the EPISERVER_SEARCH_DISPLAYTEXT?

My model is (very simplistic):

public class ExamplePage : PageData
{
    [Searchable(true)]
    public virtual string MetaKeywords { get; set; }

    [Searchable(true)]
    public virtual string MetaDescription { get; set; }

    [Searchable(true)]
    public virtual string Intro { get; set;}

    public virtual ContentArea ContentBlocks { get; set; }
}

Then, after doing a search, the relevant part of the searchpage template is:

  • @result.Name

    @Html.Raw(result.Text)

    @result.Created
  • #112865
    Nov 06, 2014 14:51
    Vote:
     

    Anyone?

    Basically, I do want to search on a field, but I don't want that field to be included in the EPISERVER_SEARCH_DISPLAYTEXT field in Lucene. I can't be the only one with such a requirement, can I?

    #113239
    Nov 17, 2014 8:32
    This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
    * 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.