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

Forums / General Discussions / Search Function not working

Search Function not working

13 posts, 0 answered
  1. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    I have a search function implemented and was working great. Recently, I did a "Start indexing" for a particular Index in Administration > Search, the index status looks fine.  But when I do a search, it only return the first page, the page I specified in "Starting node to index". Nothing else return on the search results.

    Any idea why? Is this something to do with the Application Pools in IIS?

    Thanks,
    Pik
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Nov 2010
    Link to this post
    Hello Pik Lee,

    Can you please let us know which version of Sitefinity you are using? You can follow the instructions from this article to check your SF version. Can you please check if you have selected the index to index public pages and if the pages under the starting node are set to deny anonymous. If this is all fine this means that probably on some of your pages you have control which breaks the indexer.

    Greetings,
    Radoslav Georgiev
    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
  3. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    Thanks for the reply.  I am using SF version 3.7.2096.220. The page I indexed is not public page, and it set deny anonymous. It is working for other "deny anonymous" pages with different indexes. Just this particular one not working correctly. I even deleted any new implemented pages before I restart "Start indexing". Do I need to restart the site in IIS?

    Thanks,
    Pik
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hi Pik,

    If you have narrowed down the issue to a particular page only, then there is some code in the page that prevents it from indexing. The issues we know about are related to some code that uses session objects, context identity or FormsAuthentication methods like SignOut()

    Greetings,
    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
  5. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    My logout code is follow.       
         
            Session.Abandon();
            System.Web.Security.FormsAuthentication.SignOut();

           string group = Request.Form["group"];

            if (group == "A" || group == null)
            {
                Response.Redirect("~/A.aspx");
            }
            else
            {
                Response.Redirect("~/B.aspx");
            }

    Thanks,
    Pik
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hello Pik,

    And this is the problem. When the crawler goes to FormsAuthentication.SignOut(); this skip the page from indexing.
    You can add the code you have in a block that escapes the crawler request

    if (!CmsContext.IsRequestCrawler(this.Context))
    {
     // do something
     
    }



    Greetings,
    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
  7. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    I updated my code and I received the following error message:
        error CS0103: The name 'CmsContext' does not exist in the current context

    What did I do wrong?  Here is my updated code:


    if(!CmsContext.IsRequestCrawler(this.Context))

    {

             Session.Abandon();
            System.Web.Security.FormsAuthentication.SignOut();

           string group = Request.Form["group"];

            if (group == "A" || group == null)
            {
                Response.Redirect("~/A.aspx");
            }
            else
            {
                Response.Redirect("~/B.aspx");
            }
     
    }


    Thanks,
    Pik
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hi Pik ,

    Use Telerik.CmsContext.

    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
  9. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    Thanks for the info.  I found out that when I do a search on certain words, I get the following error message.

    Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

    Is that a way to find out which page cause this problem
    in the database instead of go thru all the tables?

    Thanks,
    Pik
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Nov 2010
    Link to this post
    Hello Pik ,

    You have some custom code in SearchResults control or its template which uses some value as a Guid, but this value is not a valid guid. Please check the control template and whether you use a custom control that inherits from SearchResults. If this is the case implement a guid validator over the value you use, so that you will not get an exception.

    Kind regards,
    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
  11. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    I noticed the field I specified in fieldsInfoProvider.xml  does not work on my search. It was working before. Any idea why?

    Thanks,
    Pik
  12. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    Still have no idea what I did wrong. My site is arrange like this. The index start node is PageA, when do search the result return only PageA not PageA1, PageA2 and PageA3.

    PageA
        PageA1
        PageA2
        PageA3

    Any idea??

    Thanks,
    Pik
  13. Pik Lee
    Pik Lee avatar
    142 posts
    Registered:
    13 Aug 2012
    05 Nov 2010
    Link to this post
    Fixed it. It was a session object in the template file. Thank you so all your help.

    Thanks,
    Pik
Register for webinar
13 posts, 0 answered