Search query examples
These are examples of search queries we can create using an HTML element.
Simple search query
<form action='<PathCmpnt type="servlet" /> /library/sitearea/content' method="post"> <table> <tr> <td> <input type="text" name="search_query"/> </td></tr> <tr> <td align="right"> <input type="submit" value="Search"/> </td></tr> </table> </form>
Search metadata
In this example, two more fields have been added allowing users to search both content title and author name:
<form action='<PathCmpnt type="servlet" /> /library/sitearea/content' method="post"> <table> <tr> <td>Content Title</td> <td><input type="text" name="search_title"/></td> </tr> <tr> <td>Author's Name</td> <td><input type="text" name="search_authors"/></td> </tr> <tr> <td>Content Body</td> <td> <input type="text" name="search_query"/> </td></tr> <tr><td align="right"> <input type="submit" value="Search"/> </td></tr> </table> </form>
Restrict results using hidden field
In this example, a hidden field has been added to restrict the search to content using the authoring template called "Press Release":
<!-- Here a hidden input field has been added that searches for content using the authoring template called "Press Release". --> <form action='<PathCmpnt type="servlet" /> /library/sitearea/content' method="post"> <input type="hidden" name="search_authoringtemplate" value="Press Release"/> <table> <tr> <td>Content Title</td> <td><input type="text" name="search_title"/></td> </tr> <tr> <td>Author's Name</td> <td><input type="text" name="search_authors"/></td> </tr> <tr> <td>Content Body</td> <td> <input type="text" name="search_query"/> </td></tr> <tr><td align="right"> <input type="submit" value="Search"/> </td></tr> </table></form>
Parent Create a search query