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
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?
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.
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.
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 :/
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 :)
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:
Any ideas?
I have the same error. I think it has something to do with the index not working properly..
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
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? :)
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.
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 :/
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 :)
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
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?
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 :)
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
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
Hi Thomas,
Tell me how to modify after creating indexes using ExamineIndex admin dashboard.
Priya
is working on a reply...