Create a search query

 

+

Search Tips   |   Advanced Search

 

A search query is created using an HTML element.

 

Simple search query

 

<form action='<PathCmpnt type="servlet" />/library/site/sitearea/content' 
      method="post">

This is the form header where specify location of the content item containing the search element used to display the search result.

This is usually the same content item that this HTML element is stored in.

 

<table>
    <tr><td>
        <input type="text" name="search_query"/>
    </td></tr>
    <tr><td align="right">
        <input type="submit" value="Search"/>
    </td></tr>
</table>

This is the body of the search form. Like any standard HTML form it contains an input field and a submit button.

In this example, a table has been used to format the search query form.

 

</form>

This closes the form.

 

Searching 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/site/sitearea/content'
      method="post">

This is the form header where specify location of the content item containing the search element used to display the search result.

This is usually the same content item that this HTML element is stored in.

 

<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>

This is the body of the search form. Like any standard HTML form it contains input fields and a submit button.

See below for a list of search parameter names.

 

</form>

This closes the form.

 

Including hidden data

In this example, a hidden field has been added to restrict the search to content that use the authoring template called "Press Release":

 

<form action='<PathCmpnt type="servlet" />/library/site/sitearea/content'
      method="post">

This is the form header where specify location of the content item containing the search element used to display the search result.

This is usually the same content item that this HTML element is stored in.

 

<input type="hidden" 
       name="search_authoringtemplate"
       value="Press Release"/>

Here a hidden input field has been added that searches for content that use the authoring template called "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>

This is the body of the search form. Like any standard HTML form it contains input fields and a submit button.

 

</form>

This closes the form.

 

Search parameters

The following parameters can be used in a search query in this format:

 

    <input name="search_parameter" />

search_query Used to search the content of any elements stored in a content item.
search_authoringtemplate Used to search the authoring template, if available, that was used to create the content item.
search_authors Used to search the name or names of the authors for the content item, if any are defined.
search_categories Used to search the categories of the content item if any are defined.
search_description Used to search the description of the content item.
search_effectivedate Used to search the effective date of the content item.
search_expirationdate Used to search the expiration date of the content item.
search_keywords Used to search the keywords of the content item if any are defined.
search_lastmodifieddate Used to search the last modified date of the content item.
search_modifier Used to search the name of the last person to modify the content item.
search_name Used to search the name of the content item.
search_owners Used to search the name or names of the owners of the content item, if any are defined.
search_title Used to search the title of the content item.

 

Parent Topic

Create a search form