Search Configuration

Search is an essential feature of any web site. Webaptive is designed specifically for web applications, and for that reason its search feature is highly configurable. Like all Webaptive features, displaying search can be done without having to embed any third-party controls or referencing a third-party SDK.

Creating Search User Control

Before configuring a page to display search results you will need to create an ASP.Net user control that Webaptive can interact with. The user control must implement this interface.

    public interface IWebaptiveSearch
    {
        int SearchType { get; }
        string SearchQuery { get; }

        void DataBind(DataSet ds);
    }

SearchQuery: Returns string to search for.
SeachType: Returns the the type of search (0=Exact match, 1=Any words, 2= All words).
DataBind: Accepts a dataset and displays it.


 

The dataset returned by Webaptive contains all the data needed to display the results. Click here to download a sample search user control.

Only a web page with a control that implements the about interface can be configured to display search. After a web page is configured Webaptive will query the configured user control for the search query and type and then call the configured method to pass in the results as a dataset.


Configure Search Results Page

To configure a web page to display search results click on "Search Configuration" (Main Console > Manage Content > Manage).


In the resulting dialog select the properties and methods that match the above interface and click enable (the user control doesn't have to "implement" any interface, just "match" it to ensure that the interface doesn't break. It's best to create and implement the above interface. The names of the interface members can be changed; only the return types and parameters need to match). If the page does not have a user control that matches the above interface an error will be displayed. After that click "Enable" and the page is ready to display search results.


Tip: The display of the results can be finely controlled. For example, in an e-commerce site the user control can filter out product pages to display prices and add an add-to-cart button to the result.







Next Publishing

   
Valid XHTML 1.0 Transitional Valid CSS!
 
 © Copyright 2011 Striquent LLC. All rights reserved.