I need to be able to search on member custom properties for a site, displaying the results in a list. Trouble is, getting the custom properties for each member seems to take ages - with just 95 members it takes about 7 seconds to populate a list of members by getting custom properties with "foreach (Property p in m.GenericProperties)"- not good enough for a public search function.
If you have uComponents installed, you could take a look at the uQuery GetMembersByXpath method; this does a single DB hit to get all the members in an XML document, and so should be quicker.
Alternatively how about a Lucene query against the InternalMember index ?
I think the problem I have is that I will be searching on a calculated field as it's a geo search - so I generate a geocode from a postcode, then calculate a distance from the stored location for each member, and resturn results based on that.
I think the problem is I don't know that much about how the members work, and I'm getting bogged down in all the deprecated stuff vs the .NET model that is now recommended, even though it's a lot more annoying :o)
So are members published to XML then? Is there a built in way to get the members XML document or do I have to use uComponents? No biggie if so, it's already on the site.
Getting member custom properties very slow
I need to be able to search on member custom properties for a site, displaying the results in a list. Trouble is, getting the custom properties for each member seems to take ages - with just 95 members it takes about 7 seconds to populate a list of members by getting custom properties with "foreach (Property p in m.GenericProperties)"- not good enough for a public search function.
Is there any way of speeding this up?
Hi Rob,
If you have uComponents installed, you could take a look at the uQuery GetMembersByXpath method; this does a single DB hit to get all the members in an XML document, and so should be quicker.
Alternatively how about a Lucene query against the InternalMember index ?
HTH,
Hendy
Hmmm, haven't ever looked at the Lucene stuff at all, might be worth a shot! I'll look at the uQuery stuff, thanks!
I think the problem I have is that I will be searching on a calculated field as it's a geo search - so I generate a geocode from a postcode, then calculate a distance from the stored location for each member, and resturn results based on that.
I think the problem is I don't know that much about how the members work, and I'm getting bogged down in all the deprecated stuff vs the .NET model that is now recommended, even though it's a lot more annoying :o)
So are members published to XML then? Is there a built in way to get the members XML document or do I have to use uComponents? No biggie if so, it's already on the site.
I've tried the uQuery tried, that's blindingly quick, so I've marked that as the answer :o)
is working on a reply...