Skip Navigation
PrintPrint version

Basic Search Code

To add basic search code to your site, you will need to decide which type of parameter (site search or collection) is best for you.

Site Search vs Collection Parameter

When you look at the sample form code provided by Service Nova Scotia, one of the hidden parameters is called "sitesearch". If you wish to search only your domain or sub folder(s), this parameter should be used.

In some cases there may be benefit to searching content from folders or domains that are not part of the same tree. In these cases Service Nova Scotia must create what is called a collection for you.

For example, we created a collection called "GOVNS" that combines the URLs crawled on both the gov.ns.ca and ednet.ns.ca domains onto one integrated search. This way, even though the content comes from two different domains (trees), it may be searched from one search box.


In these cases a developer would have to replace the sitesearch parameter:

<input type="hidden" name="sitesearch" value="http://www.gov.ns.ca/yourdirectory">

With the collection parameter:

<input type="hidden" name="site" value="your_collection">

Search Code