I've tried to add custom fields to the member index, in order to be able to search and sort by custom fields.
This is to replace use of the memberservice, which is extremely costly with the amount of members there are.
I've tried including certain fields, and I've tried the exact example in that link. When rebuilding the index, nothing is any different.
Is there something I'm missing here? does anyone have a link to a working example?
My full code for this to be perfectly clear as to where I currently am:
using Examine;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
using Umbraco.Examine;
using Umbraco.Core;
namespace lib.util.Umbraco
{
public class CustomizeIndexComposer : IUserComposer
{
public void Compose(Composition composition)
{
// replace the default IUmbracoIndexConfig definition
composition.RegisterUniqueFor<IUmbracoIndexConfig, CustomIndexConfig>();
}
}
// inherit from the default
public class CustomIndexConfig : UmbracoIndexConfig, IUmbracoIndexConfig
{
public CustomIndexConfig(IPublicAccessService publicAccessService) : base(publicAccessService)
{
}
// explicit implementation - overrides base class.
// GetMemberValueSetValidator is used for the MemberIndex.
IValueSetValidator IUmbracoIndexConfig.GetMemberValueSetValidator()
{
// NOTE - by default Umbraco only includes a small subset of fields for the member index for
// security reasons, however you may want to include a larger set of data in the member index.
// This example will include all data for a member excluding the built in property values.
// all built in member properties to exclude (i.e. Password question, etc...)
var excludeFields = Constants.Conventions.Member.GetStandardPropertyTypeStubs().Keys;
// include everything except the above
return new MemberValueSetValidator(null, null, null, excludeFields);
}
}
}
Everything said there points to creating a custom index. I just want to modify the existing member index, as i dont want there to be multiple indexes unnecesarily.
The link to the documentation and my code are supposed to just override GetMemberValueSetValidator() to do this, but it doesn't appear to do anything at all. building indexes doesnt even step into it..
search Member index by custom fields
Hi!
I've tried to add custom fields to the member index, in order to be able to search and sort by custom fields. This is to replace use of the memberservice, which is extremely costly with the amount of members there are.
I took the code from the documentation, here: https://our.umbraco.com/documentation/reference/searching/Examine/indexing/#changing-ivaluesetvalidator
I've tried including certain fields, and I've tried the exact example in that link. When rebuilding the index, nothing is any different.
Is there something I'm missing here? does anyone have a link to a working example?
My full code for this to be perfectly clear as to where I currently am:
https://our.umbraco.com/forum/using-umbraco-and-getting-started/102489-umbraco-8-examine-member-searching-examples
I think there is a bunch of stuff here
Everything said there points to creating a custom index. I just want to modify the existing member index, as i dont want there to be multiple indexes unnecesarily.
The link to the documentation and my code are supposed to just override GetMemberValueSetValidator() to do this, but it doesn't appear to do anything at all. building indexes doesnt even step into it..
Hey Dave,
did you manage to get the job done? If yes, what was your approach?
Thanks,
Dee
I would like to know as well :)
@Robin: Here is the solution:
https://github.com/umbraco/Umbraco-CMS/issues/8766
@Dee just wanted to say thanks! :-)
YW!
is working on a reply...