This tag executes a search query and returns search results. The search tag retrieves a query string and collections from either a form parent tag or the query and collection attributes. The search results are saved in the page context with a page or session scope.
The search tag uses the following attributes:
formId. Specifies the name of the form used for the search. The default form is used if the attribute is left empty. If this tag is used without a form, this attribute must be set to provide an identifier for the resultIterate tag.
collection. (Optional) A comma-delimited string representing collections used for a search. If form action exists, this attribute is ignored and the values are retrieved by requesting the collection element.
query. (Optional) Specifies the query text. If not provided, the text is retrieved from the query element.
scope. Specifies an integer indicating the scope of the search results. The value 1, which is the default, indicates page scope. 2 indicates session scope.
This search tag uses the default parameters and executes a search. The search results are saved in pageContext with a page scope.
<s1ws:search Collection="col1, col2" Query="Java Web Service" scope="2" />
This search tag executes a search in col1 and col2 using "Java Web Service" as the query string. The search results are saved in pageContext with a session scope.