Some sites may need to make multiple repositories available for searching. For example, suppose your site has, in addition to a product catalog, a repository with informational articles about the products. When a user searches for, say, mountain bikes, you want to return both products and articles. You could enable this by creating a single index that includes items from both repositories, and returning both types of items in the same set of results.

If, however, you want products and articles to appear as separate sets of results, displayed on different areas of the page, then including them in the same index is not desirable. Instead, you can create separate indexes for the two repositories, and use two form handlers that submit the same query text simultaneously to the two indexes.

To invoke multiple form handlers simultaneously, you use a component of class This is a special form handler class that invokes multiple QueryFormHandler components, using the same query text for all of them.

You configure a MultipleSubmitHelper component by setting its queryFormHandlers property to an array of the QueryFormHander components you want to invoke. For example, the /atg/search/formhandlers/MultipleSubmitHelper component (used by the QueryConsole sample application) is configured like this:


In your JSP, you create the search form as shown in the following example:

<%-- create the query text input field and associate it with the --%>
<%-- handleQuestion method of the MultipleSubmitHelper component --%>
<dsp:input type="text" id="question" size="30" converter="nullable"
           name="question" bean="MultipleSubmitHelper.question"/>

<%-- create the submit button and associate it with the handleSearch --%>
<%-- method of one of the QueryFormHandler components --%>
<dsp:input type="submit" bean="" value=" Search "
           action="multiquerysubmit.jsp" priority ="-100"/>

<%-- create a hidden field on the other QueryFormHandler components --%>
<dsp:input type="hidden" bean="" value=" Search "
           action="multiquerysubmit.jsp" priority ="-100"/>
loading table of contents...