Search more than one field default EPiServer Search

Vote:
 

Hello, I have the following code.

 

<spanclass="searchtitletext">Search For:<asp:TextBoxID="txtSearch"runat="server"></asp:TextBox>

<asp:ButtonID="btnSearch"runat="server"Text="Search"onclick="btnSearch_Click"/></span>

<br/>

<br/>

<hr/>

<EPiServer:SearchDataSourceID="sdsSearch"runat="server"PageLink="175">

<SelectParameters>

<asp:ControlParameterControlID="txtSearch"Name="SearchQuery"PropertyName="Text"/>

</SelectParameters>

</EPiServer:SearchDataSource>

 

Which bring back search results based on the page name- however how do I tell it to search an extra field, called "SearchText" which will just be a string the user manually enters.

Am under time pressure on this, so would appreciate a fast-ish repsonse!!!

Many Thanks.

Marc.

#66171
Feb 21, 2013 16:39
Vote:
 

Hello guys, sorry for double post, but am majorly struggling with it. I'm assuming I need to add another Control Parameter, but it says that it then doesnt exist in the SearchQuery.

Appreciate this is probably really simple, but am going insane with it!

Marc.

#66183
Feb 22, 2013 10:54
Vote:
 

Do you mean that EPiServer should use the text some editor writes in the text property you have called SearchQuery and return results based on it? If so, the only thing you have to do is to set that property to be searchable, either via PageTypeBuilder or in admin-mode on the pagetype if you do not use PageTypeBuilder. You do not have to add another ControlParameter for that. 

Or do you mean something else?

#66241
Feb 25, 2013 15:22
Vote:
 

It really was that simple - I feel like an idiot now! Literally that search box in the admin mode needed ticking!

Thankyou Andreas, I was expecting it to be more technical than that!

#66248
Feb 25, 2013 16:53
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.