I have two custom modules, with the following metakeys:
A Publication can be linked back to a Member via the UserID metakey.
I need to produce a pageable set of results for "All Publications WHERE County = 'London'". The only way I have been able to do this is to loop through all Members, then search for Publications with the matching UserID. The problem is this code is taking about 6 seconds to run - so is not possible on a production site.
My code is:
//create an instance of the membersModule content manager
ContentManager oMembersMgr =
//create an empty filter
List<IMetaSearchInfo> oMembersFilter =
//only filter on county if one has been provided
//create a filter on county (or Wildcard)
._county == Convert.ToString(0)) ?
._county), SearchCondition.Equal, JoinType.And));
//get the members
IList oMembers = oMembersMgr.GetContent(0,0,
, ContentStatus.Published, oMembersFilter.ToArray());
//create an empty list for storing the publications
IList oPublications =
//loop through each member
//create an instance of the publicationsModule content manager
ContentManager oPublicationsMgr =
List<IMetaSearchInfo> oPublicationsFilter =
IList oResults = oPublicationsMgr.GetContent(0, 0,
, ContentStatus.Published, oPublicationsFilter.ToArray());
Is there a better, more efficient way of doing this?