More in this section

Forums / Developing with Sitefinity / News link in Search results

News link in Search results

6 posts, 0 answered
  1. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    06 Mar 2009
    Link to this post
    Hi

    I have a search index created for the whole site including news section. When i search for news related content using search box (sitefinity search box), it does displays search results related to my search. But when i click on any of the result links, i am taken to news summary view page, but in reality i would expect to be taken to news article page.

    Can you provide your inputs on this.

    Thanks
    Durga
  2. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    06 Mar 2009
    Link to this post
    Hi Durga,

    If you are taken to the summary page, it means you are using the Page Index which indexes the page content and the article itself is not part of that content. Now if you want to be taken to the article itself you should use News Index. This way when you click on the news item, it will take you directly to the article.

    Hope this helps.

    Regards,
    Nikolai
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    18 Mar 2009
    Link to this post
    Hi Nokolai

    Thanks for your reply. But my requirement is when i search for some keywords, if its found both in a news item and content items, then my search result should display both with news results linking to news details page and content results linking to content pages.
    To achieve this, i created a site index which also included News index.

    But based on your reply, if i create a News index separately, then how can i make my search box to search in both site index, news index simulataneously.

    Thanks in advance for your support.
    Regards
    Durga N
  4. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    18 Mar 2009
    Link to this post
    Hello Durga,

    In order to use both indexes, you could exclude the NewsView Control from the PageIndex, so that all news results will come from the News Index, not from the NewsView control of the Page Index.

    You can do this by excluding the content place holder, where the NewsView Control is placed,from the PageIndex:

    1. Open the ~\App_Data\Search\YourSearchIndexName\fieldsInfoProvider.xml file
    2. Add the following line:
    <field name="JustTypeSomeName" weight="-1" indexAttribute="" filterTag="div" filterAttributes="id:TypeIDofThePlaceHolderHere" /> 

    Have in mind that you need to add such a line for each NewsView control and put its content placeholder ID in the filterAttribute property.
    3. Re-index

    Hope this helps.

    Best wishes,
    Nikolai
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Durga
    Durga avatar
    10 posts
    Registered:
    14 Sep 2005
    18 Mar 2009
    Link to this post

    Hi

    Thank you very much for your prompt response.

    Can you clarify on the which id that i have to specify in siteindex's xml file to exclude news items

    1.Id of the container control that i have defined in my masterpage template?
    ie.<asp:contentplaceholder id="MainPageContent1" runat="server" />

    2. Id of the news view control (i have made a custom news view control for my site) that i see in CMS page
    ie. Choose page in sitefinity module, click on edit in 'MainPageContent1' control which has my 'CustomNewsview' control bound to. In properties popup --> Misc--> Id field value
     
    3. Id of the news view control that is rendered in the browser?
    ie. control id rendered is something like 'ctl00_MainPageContent1_CustomNewsView1_ctl00_ctl00_repeater'

    I did look for answer in developers manual, but couldnt get it. If there is any reference on this available online, do share the link with me.

    Also i did try specifying #1 and #2 as you said in the fieldsinfoprovider.xml, and reindexed it, But i have the newsviewcontrol page also got listed in my search results. Is there any cache reset to be done for search results refresh?
    Let me know if i am not in right direction.

    Thanks
    Durga

     

  6. Nikolai
    Nikolai avatar
    216 posts
    Registered:
    01 Jun 2017
    19 Mar 2009
    Link to this post
    Hi Durga,

    You need the id of the <div tag. Basically it should look something like this:
    <div id="TopNavigation"
                    <asp:contentplaceholder id="TopMenu" runat="server"></asp:contentplaceholder>             
                </div> 

    You need the div id which in the case above is "TopNavigation".
    Hope this made it more clear.

    Sincerely yours,
    Nikolai
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
6 posts, 0 answered