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

Search

2 posts, 0 answered
  1. sathiyaseelan
    sathiyaseelan avatar
    82 posts
    Registered:
    26 Aug 2008
    28 Mar 2011
    Link to this post
    Dear sir,
     I am using searchManager(Custom Seach) to search the sitefinity pages. Now i need to filter the results. I don't want to show the pages which are set navigation=false in sitefinity.

    Can I able to make it.

    Here is my sample code right now I used:

                                IList<ResultItem> results = SearchManager.Search(strsearchQuery, IndexCatalogue);

                                for (int i = 0; i < results.Count; i++)
                                {
                                    if (results[i].Url.Contains("/en/") && sLanguageName == "en-US" && results[i].Url.Contains(".aspx"))
                                    {
                                        dtSearch.Rows.Add(results[i].Title, results[i].Snippet.Replace("...", ""), urlRequest + results[i].Url, results[i].Score, DateTime.Now);
                                    }
                                    else if (results[i].Url.Contains("/ru/") && sLanguageName == "ru-RU" && results[i].Url.Contains(".aspx"))
                                    {
                                        dtSearch.Rows.Add(results[i].Title, results[i].Snippet.Replace("...", ""), urlRequest + results[i].Url, results[i].Score, DateTime.Now);
                                    }
                                }
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    28 Mar 2011
    Link to this post
    Hello sathiyaseelan,

    First you need to inject the page ID through the indexer info XML that is available under App_Data/Search/[Your Index]. Then you need to get the ID from the snippet of the result item and use CmsManager to resolve the ICmsPage object. This is actually a hack, but it works.

    Greetings,
    Ivan Dimitrov
    the Telerik team
2 posts, 0 answered