Digital Serenity

Digital Serenity is the blog of John McPherson Leask III (Jay). His mind wanders from food to travels, every-day activities and humor to sports, podcasting and technology - though mostly the focus of Digital Serenity will be his technological exploits.

QueryOverrides and the GroupsToSearch attribute

QueryOverrides allow great customizations to lists (WeblogPostList / IndexPostList / etc) including page sizes, sections to search on, sort instructions and much more.

In this particular case I need to search by multiple sections.  While the SectionApplicationKeysToSearch or SectionIDsToSearch options would work, Community Server has blog groups, making it easy to group blogs together.  Conveniently the QueryOverrides have the option GroupsToSearch ... should be easy, and in fact it is; once you know what to put there.

The amazing wealth of information over at GetBen.com has about 99.9% of everything you could need to know about CS controls ... including the instructions that CS expects a string value for this option.  What took me hours to figure out (because, apparently, my head wasn't in quite the right frame of mind) was that the GroupsToSearch is actually looking for a comma (see? string!) separated list of integers, the IDs of the groups you wish to search on.

So, while I was putting in: GroupsToSearch="MyGroup,MyOtherGroup"; what was expected, and the reason I was getting the Input string was not in a correct format error, was GroupsToSearch="3,5"

I hope this helps someone save a few minutes compared to what I lost this evening ...

Published Tuesday, August 26, 2008 6:50 PM by jleask

Comments

No Comments