Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 26, 2011 @ 12:02
    Fuji Kusaka
    0

    Search in Member Section

    Has anyone ever came across this error message when using the Search in the Member Section?

    The really weird part of it, is that i only get this message when the Member is present. If a Search for a Member where i know the result will be 'Null' it looks fine.

    Server Error in '/' Application.

    The given key was not present in the dictionary.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [KeyNotFoundException: The given key was not present in the dictionary.]
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +12684111
       umbraco.presentation.umbraco.members.MemberSearch.<ButtonSearch_Click>b__5(SearchResult x) +147
       System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +238
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +680
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +167
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
    

    Any ideas?

  • Tommy Albinsson 121 posts 254 karma points
    Sep 05, 2011 @ 10:29
    Tommy Albinsson
    0

    I have the same error. I think it has something to do with the index not working properly..

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 05, 2011 @ 11:22
    Fuji Kusaka
    0

    Hi Tommy,

     

    I finally got the search working under the member section. Can you tell me how you are adding your members ? and under which version are you working on?

    //fuji

  • Tommy Albinsson 121 posts 254 karma points
    Sep 05, 2011 @ 13:44
    Tommy Albinsson
    0

    I have tested to add members only from the backend, the same error occurs. I have also tested to add them through the webservice from an application. Same error when searching.

    I am running version 4.7.0.

    How did you solve the problem? :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 05, 2011 @ 14:30
    Fuji Kusaka
    0

    Hi Tom,

    Am running under version 4.7.0 as well, and using contour to register my members under the member section. What i did was to simply change the mapping of the field when registering the members.

    So may be you should consider checking  if you dont have 2 different field with the Named the same way. Try change for example your Email to Email Address under your Member Type (generic Properties).

    The other way would also be to removed all the members you entered and give it a try adding 2-3 Manually, and make a search for the Name.This is how I proceeded just to get to know more on how the members section works.

     

     

  • Tommy Albinsson 121 posts 254 karma points
    Sep 08, 2011 @ 12:03
    Tommy Albinsson
    0

    Hi Fuji,

    Thanks for the answer.

    I did try the above suggestions but i still can't get it to work. I did remove the email index a long time ago since i saw in the log that it was not unique. I still get the given key was not present exception :/

  • Jesper Bunch 4 posts 25 karma points
    Sep 14, 2011 @ 09:24
    Jesper Bunch
    0

    I have the exact same problem.

    I looked through the umbraco code for the membersearch and the following code is executed: 

    UmbracoContext.Current.InternalMemberSearchProvider.Search(query, false).Select(x => new MemberSearchResult()
                        {
                            Id = x["id"],
                            Name = x["nodeName"],
                            Email = x["email"],
                            LoginName = x["loginName"]
                        });

    However the Search method does not include "email" in the fields of returned ISearchResults and that causes the error in Email = x["email"].

    Next question must be why email is not part of the search result :)

  • Fuji Kusaka 2203 posts 4220 karma points
    Sep 14, 2011 @ 11:57
    Fuji Kusaka
    0

    Hi Jesper,

    What version of umbraco are you using?....As i mentioned in my previous post i got it working again by changing the mapping of my fields.

    However my LoginName is in fact the Email Address input field.

     

    //fuji

  • Jesper Bunch 4 posts 25 karma points
    Sep 14, 2011 @ 12:25
    Jesper Bunch
    0

    I'm using 4.7.0. The email field is the standard Umbraco member field, I don't think there's a way to change that?

  • Jesper Bunch 4 posts 25 karma points
    Sep 14, 2011 @ 13:23
    Jesper Bunch
    1

    Well I found the issue. The "problem" is that I have used email as a property name in one of my document types. In Examine.LuceneEngine.Providers.LuceneIndexer.AddDocument(..) the UserFields is loaded with all the field names from the CMS and is appended with the standard fields for the member indexer which also includes email.

    That results in the indexedFields to have 2 email fields which causes the code not to index the email field.

    So now the big question is why LuceneIndexer uses the CMS fields for the member indexing :)

  • Thomas Ottosen 14 posts 34 karma points
    Nov 10, 2011 @ 20:56
    Thomas Ottosen
    0

    Hi Jesper

    Having the same "problem" with a property name called "email". I renamed the property, but same error. Did you rebuild Lucene Index? and if so how?

    Thomas

  • Jesper Bunch 4 posts 25 karma points
    Nov 11, 2011 @ 09:16
    Jesper Bunch
    0

    Hi Thomas

    I used this dashboard control to rebuild the index(es): http://our.umbraco.org/projects/backoffice-extensions/examine-index-admin

    Remember to modify it so it matches your own indexes.

    // Bunch

  • priya 25 posts 45 karma points
    Feb 14, 2012 @ 11:24
    priya
    0

    Hi Thomas,

    Tell me how to modify after creating indexes using ExamineIndex admin dashboard.

    Priya

Please Sign in or register to post replies

Write your reply to:

Draft