The main form handler for submitting queries to Oracle ATG Web Commerce Search is atg.search.formhandlers.QueryFormHandler. This form handler issues a search request of class atg.search.routing.command.search.QueryRequest, which represents a query of type <query>.

QueryFormHandler has as an ancestor the atg.search.formhandlers.BaseSearchFormHandler abstract class, which implements generic functionality: error handling, URL redirection, maintaining state information, query submission, etc. QueryFormHandler subclasses PagedRequestFormHandler, which is a subclass of BaseFormHandler that adds support for paging of results.

QueryFormHandler constructs search queries using the SearchClient API. This API uses an instance of Routing to direct those queries to the search engine. This instance of Routing can be running locally (on the same Oracle ATG Web Commerce instance as the SearchClient) or remotely (on a different instance). Information about the connection to Routing is maintained in a session-scoped component of class atg.search.formhandlers.SearchContext. The form handler and request classes themselves are designed to be request-scoped.

QueryFormHandler has a handleSearch method that issues the search query. Typically, you associate this method with a form button, so the query is issued when the user clicks the button. For example:

<dsp:input type="submit" bean="QueryFormHandler.search" value=" Search "
   action="query.jsp"/>

QueryFormHandler includes a number of other handler methods that you may find useful in building search forms. See the ATG Platform API Reference for more information.