Erik
-
2/19/2009 9:47:12 AM
CMSSearchResults and multi-field document type search
We're working on a site that requires a few document types, one of which I need to set up a search for. They would like to search by as many as four criteria fields (first name, last name, town, and specialty -- this is a doctor search). The name and town fields are simple text fields, but the specialty field is a CheckBoxList that is filled by another custom document type in the database.
I was hoping to use the out-of-the-box CMSSearchResults control to feed the search criteria, but I am not getting back any results, and no errors either. Here's my markup for the control:
<cms:CMSSearchResults ID="results" runat="server" SearchMode="AnyWord" FilterOutDuplicates="true" ClassNames="medical.physician" TransformationName="medical.physician.SearchResults" SearchScope="SearchAllContent" CMSSearchDialogID="cmsSearch" PagerControl-PageSize="20" PagerControl-PagerPosition="TopAndBottom" PagerControl-PagerHTMLAfter="<br /><br />" />
The code-behind that does the search:
results.SearchExpression = (txtFirstName.Text.Trim() + " " + txtLastName.Text.Trim() + " " + txtTown.Text.Trim()).Trim(); if (results.SearchExpression.Trim() != "") { results.DataBind(); }
Anyone with experience doing document type searching via multiple criteria fields? I am aware of the custom search provider possibility, but would like to avoid that (trying to go out-of-box as much as possible). The more I think about it, though, I think this might be required in order to support the CheckBoxList field described above.
Erik Bertrand Amplify Studios Manchester, NH USA
|