More in this section

Forums / Developing with Sitefinity / Hiding Generic Content from Search

Hiding Generic Content from Search

2 posts, 0 answered
  1. Mark
    Mark avatar
    3 posts
    26 Mar 2009
    27 Mar 2009
    Link to this post

    I'm using sitefinity 3.1 and have some text in generic content that appears on everypage (via a template). It's like a short "About". Unfortunately, any search terms that appear in the "about" text become difficult to search for as the search results just bring back every page..

    What i would like to do is hide the contents of that one Generic Content from the search engine indexer. Is there a way to do this via the SF interface?

    If not i'd happily create a custom / user control and extend Generic Content, but i'd like some ideas on how i'd go about not presenting the data to just the sitefinity search indexer.

    Thanks a lot,

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    27 Mar 2009
    Link to this post
    Hi Mark,

    You could try the following

    Open the xml located under ~/App_Data/Search/YOUR_INDEX_NAME

    The file should looks as below:

    <?xml version="1.0" encoding="utf-8"?> 
      <field name="title" weight="1" indexAttribute="" filterTag="title" filterAttributes="" /> 
      <field name="keywords" weight="1" indexAttribute="content" filterTag="meta" filterAttributes="name:keywords;" /> 
      <field name="description" weight="1" indexAttribute="content" filterTag="meta" filterAttributes="name:description;" /> 
      <field name="script" weight="-1" indexAttribute="" filterTag="script" filterAttributes="" /> 
      <field name="style" weight="-1" indexAttribute="" filterTag="style" filterAttributes="" /> 

    name = some name
    weight = -1 will not be indexed
    weight = 1 will be indexed

    You could try to get the control ID from the HTML - it should be the same for all pages. Then set the following attributes

    filterTag = the html tag that will be filtered - for example the div.
    filterAttributes - we pass the id of our div element.

    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
2 posts, 0 answered