1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Ranking search results

Ranking search results

7 posts, 1 answered
  1. Marc Van Pottelbergh
    Marc Van Pottelbergh avatar
    4 posts
    Registered:
    26 Nov 2009
    09 Dec 2009
    Link to this post
    Hello,

    I'm new to Sitefinity and I was wondering if it's possible to rank the results from a search based on the Sitefinity Search Index.

    For example; when a visitor enters the search term 'website', I want the portfolio page to be shown as the first result.
    Is there a way to perform some kind of ranking? I couldn't find anything about it in the user manual :-(

    Thanks in advance!!

    Marc
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 May 2017
    09 Dec 2009
    Link to this post
    Hello Marc Van Pottelbergh,

    You can change the weight of the results, but you cannot rank by a certain word. To change the weight of the results you should modify the file that Lucene generates under

    ~/App_Data/Search/YOUR INDEX NAME IS HERE/fieldsInfoProvider.xml

    Below is a sample

    <fields>
      <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="" />
    </fields>

    In the sample above script and styles will not be included in the index. Title, keywords and description have the same priority 1. So you can increase the weigh of any tags or controls you want to appear on the first place.


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Marc Van Pottelbergh
    Marc Van Pottelbergh avatar
    4 posts
    Registered:
    26 Nov 2009
    09 Dec 2009
    Link to this post
    Hello Ivan,

    Thanks for the fast reply!

    Correct me if I'm wrong but if I understand the answer correctly, you cannot make sure that a certain page ends on top of the search results depending on the search term.

    A small example; I have three pages (page A, page B, page C) that should end in the search result when I perform a search on 'X'. I use the weight attribute on 'keywords' and place 'X' as keyword for all three of them. Should page B end on top of the results if I place 'X' 3 times in the keywords for this page instead of 1 time like for page A and page C?

    Thanks again for your response!
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Dec 2009
    Link to this post
    Hi Marc Van Pottelbergh,

    Should page B end on top of the results if I place 'X' 3 times in the keywords for this page instead of 1 time like for page A and page C?

    This pretty much depends on how the search engine understands the match, and if it will be considered as a better (exact) match or not. If the match is better, it will be pushed on better position in the result set. In the default case, a better match will be page A and C, because they have only one "X" and you are searching for "X" exactly. If you have "X X X" in the B page though (with spaces, rather than "XXX"), these are three matches so B should go on top of A and C.

    I hope this makes sense.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  5. Marc Van Pottelbergh
    Marc Van Pottelbergh avatar
    4 posts
    Registered:
    26 Nov 2009
    10 Dec 2009
    Link to this post
    Thanks Georgi,

    If I understand your answer correctly, I can make sure that a certain page always ends up on top of the results by adding the same word multiple times in the keywords!?

    Marc

  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Dec 2009
    Link to this post
    Hello Marc Van Pottelbergh,

    Yes, this should be the case. 

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Marc Van Pottelbergh
    Marc Van Pottelbergh avatar
    4 posts
    Registered:
    26 Nov 2009
    10 Dec 2009
    Link to this post
    Thanks for clearing this out Georgi ;-)
Register for webinar
7 posts, 1 answered