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

Forums / Developing with Sitefinity / search results problem

search results problem

2 posts, 0 answered
  1. Praveen
    Praveen avatar
    8 posts
    Registered:
    23 Nov 2010
    21 Jan 2011
    Link to this post
    the search results page display wrong higlights

    say I searched the page with word "hello" it display properly and also highlights the text, but when i again search the page say "world", it display the results but appened to the previous one's highing "hello" in the first above list and below with "world"

    fyi, when we searched, all the pages had hello as well as world.. but the highlight on the top list has "hello" and next as "world"
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    21 Jan 2011
    Link to this post
    Hello Praveen,

    The SearchManager has a static method Search(string searchQuery, string indexName, int startIndex, int max, string mode, out int totalItems)  that returns IList of items. The last parameter is the total number  of hits for the search query. The actual segment is created by Lucene and we get the best fragments from there  by using Telerik.Lucene.Net.Highlight.GetBestFragment method - highlights chosen terms in a text, extracting the most relevant sections. GetBestFragment highlights chosen terms in a text. This means that if you type "cat" this string will be highlights in case it is found during crawling of the search engine. Then the ResultItem is created with the proper Title, Url etc.
    There are exceptions when you try to search page metadata  and properties (title,path, keywords, description)

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered