Below are some example use scenarios of the control, please refer to the API documentation for additional detail.
This example shows how to use the controls on a page, with no customization at all.
<%@ Page language="c#" AutoEventWireup="false" %> <%@ Register TagPrefix="searchengine" Namespace="Keyoti.SearchEngine.Web" Assembly="Keyoti2.SearchEngine.Web" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <SEARCHENGINE:SEARCHBOX id="SearchBox1" runat="server" ResultPageURL="SearchResults.aspx"> </SEARCHENGINE:SEARCHBOX> </form> </body> </HTML>
This simply holds the SearchBox page, it references the SearchResult page through it's ResultPageURL property.
<%@ Register TagPrefix="searchengine" Namespace="Keyoti.SearchEngine.Web" Assembly="Keyoti2.SearchEngine.Web" %> <%@ Page language="c#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <body> <form id="Form1" method="post" runat="server"> <searchengine:searchresult id="SearchResult1" runat="server" IndexDirectory="~/IndexDirectory"> </searchengine:searchresult> </form> </body> </HTML>
The SearchResult control will display the results for the query entered in the SearchBox page, the only configuration necessary is the IndexDirectory property - this property can be set in code behind, via the Server.MapPath property if desired. Of course, the index must be built before searches can be performed.