If not already in the site, create a new folder named "Error Pages" and create 2 new pages named "404" and "500". If the site generates any errors, the error module will redirect users to these pages. Use a basic template for these pages.
Step 3 - Search Form
Below are sample search forms which can be customised as required.
If the search is to be used on multiple pages it is recommended to save the code as an include file (e.g. search.aspx) in the "_inc" folder.
You can add custom styling to the classes.
The action should be set to point at a suitable results page.
Basic Search Form
<div class="search-box well blue-box site-search">
<h2>Site Search</h2>
<form method="get" action="/search/search-results.aspx" accept-charset="utf-8">
<fieldset>
<div class="form-group">
<input class="form-control default-value" placeholder="Keyword" type="text" name="searchValue" value="<%=Request.QueryString["searchValue"]%>" maxlength="100" />
</div>
</fieldset>
<div class="form-group">
<button class="btn btn-primary btn-md branded_button pull-right" type="submit">Search »</button>
</div>
</form>
</div>
Advance Search Form with Filtering
<div class="search-box well blue-box site-search">
<h2>Site Search</h2>
<form method="get" action="/search/search-results.aspx" accept-charset="utf-8">
<fieldset>
<div class="form-group">
<input class="form-control default-value" placeholder="Keyword" type="text" name="searchValue" value="<%=Request.QueryString["searchValue"]%>" maxlength="100" />
</div>
<h3>Filter By:</h3>
<div class="form-group half_width">
<select class="form-control required" name="topicId">
<option value="">-Select Topic-</option>
<Vuture:SuperSnippet ID="vxTopic" StoredProcedureName="usp_Vx_FrontEnd_ContentTypeCustomFields_Get" runat="server">
<parameter name="intSitePageId" type="Integer" value='<%$ vx: SITE_PAGE_ID%>' />
<parameter name="intMaxRecords" type="Integer" value='100' />
<parameter name="strContentType" type="NVarChar" value="Web.Generic-alumni_tag" />
<ItemTemplate>
<option value="<%# Container["SitePageId"] %>" <%# Request.QueryString["topicId"] == Container["sitepageid"] ? "selected" : ""%>><%# Container["PageName"] %></option>
</ItemTemplate>
</Vuture:SuperSnippet>
</select>
</div>
<div class="form-group half_width">
<select id="VxForm_Office1" class="form-control required" name="officeId">
<option value="">-Select Office-</option>
<Vuture:SuperSnippet ID="vxOffice" StoredProcedureName="usp_Vx_FrontEnd_ContentTypeCustomFields_Get" runat="server">
<parameter name="intSitePageId" type="Integer" value='<%$ vx: SITE_PAGE_ID%>' />
<parameter name="intMaxRecords" type="Integer" value='100' />
<parameter name="strContentType" type="NVarChar" value="Web.Generic-alumni_office" />
<ItemTemplate>
<option value="<%# Container["SitePageId"] %>" <%# Request.QueryString["officeId"] == Container["sitepageid"] ? "selected" : ""%>><%# Container["PageName"] % ></option>
</ItemTemplate>
</Vuture:SuperSnippet>
</select>
</div>
<h3>Date Published</h3>
<div class="form-group half_width">
<input type="text" placeholder="Date From" class="form-control datepicker-two" name="startDate" value="<%=Request.QueryString["startDate"]%>">
</div>
<div class="form-group half_width">
<input type="text" placeholder="Date To" class="form-control datepicker-two" name="endDate" value="<%=Request.QueryString["endDate"]%>">
</div>
</fieldset>
<div class="form-group">
<button class="btn btn-primary btn-md branded_button pull-right" type="submit">Search »</button>
</div>
</form>
</div>
Step 4 - Search Results
Options
enabledEmptyTextSearch - If you need to enable the search by empty text then set the as ‘true’.
strContentTypes – if the search need to be done the articles with in the specified content types. Then it can be specified by comma separator
startDate – If search articles which published date is greater than the specified start date
endDate - If search articles which published date is les than the specified end date
filterDateFromat – the date format of start date and end date value
publishedYears – filter the articles by published years. Multiple years can be specified with comma separator
publishedMonths – filter the articles by published months. Multiple years can be specified with comma separator
linkedIds1- site page Id of cross linked article. Multiple site page ids are separated with comma separator.
linkedIds2 – different set of site page Id of cross linked article. Multiple site page ids are separated with comma separator.
linkedIds3/4/5 - if you need multiple cross-linked filter you can define using linkedIDs3/4/5.
Above parameters are optional. These parameters are used in different search filters. If you need you can use mixture of parameters.
Currently this search function supports
a) Free text search
b) Search by start date and end date
c) Search by published years and published months
d) Search by cross-linked articles. It supports maximum five different type of cross-linked articles.
Basic Search Results
<vuture:sitesearchresultcontrol id="Vx605652112123" storedprocedurename="usp_Vx_SimpleSiteSearchResults_Get" runat="server">
<parameter name="intMaxRecords" type="Integer" value='10'></parameter>
<parameter name="intPage" type="Integer" value='<%$ QueryString:page %>'></parameter>
<headertemplate>
<div class="bar">
<!-- Display result text -->
<div class="count">
Your search has turned out <vuture:totalrecordscontrol id="VxTotalRecordsControl" runat="server"></vuture:totalrecordscontrol> results.
</div>
<vuture:searchpager id="Vx605652112123" runat="server" recordsperpage="10" maxpages="5" nexttext="Next" previoustext="Previous"></vuture:searchpager>
</div>
</headertemplate>
<itemtemplate>
<div class="result">
<div class="copy">
<p class="pageLink">
<a href='<%# Container.GetPageUrl(Container["SiteUrl"], Container["Path"],Container["FileName"], Container["PageType"])%>'><strong><%# Container["PageName"] %></strong></a>
</p>
<p><%# Container["Description"] %></p>
</div>
</div>
</itemtemplate>
<footertemplate>
<vuture:searchpager id="Vx605652112123" runat="server" recordsperpage="10" maxpages="5" nexttext="Next" previoustext="Previous"></vuture:searchpager>
</footertemplate>
</vuture:sitesearchresultcontrol>
Note: By default the current the search result displays "PageName" ( which has a link to page URL) as title and the page meta-data "Description" as the page description.
But the following details also can be displayed in the search result with in the '<itemtemplate>' tag.
<%# Container["SiteId"] %>
<%# Container["SitePageId"] %>
<%# Container["PageFolder"] %>
<%# Container["PageName"] %>
<%# Container["FileName"] %>
<%# Container["PageType"] %>
<%# Container["PageOrder"] %>
<%# Container["Path"] %>
<%# Container["SiteUrl"] %>
<%# Container["ContentTypeId"] %>
<%# Container["DateLastEdited"] %>
And all the custom fields data also can be used by access as
<%# Container["CustomFieldNameXXXX"] %>
If you don't need to display total result count just remove the following line from "<headertemplate>":
<vuture:totalrecordscontrol id="VxTotalRecordsControl" runat="server"></vuture:totalrecordscontrol>
If you need the pagination just remove the following line from "<headertemplate>" and "<footertemplate>"
<vuture:searchpager id="Vx605652112123" runat="server" recordsperpage="10" maxpages="5" nexttext="Next" previoustext="Previous"></vuture:searchpager>
Search by text only
<vuture:supersnippet id="Vx605652112123" storedprocedurename="usp_Vx_FrontEnd_Advanced_SiteSearch_Results_Get" runat="server" SiteSearchEnabled='true'>
<Parameter Name="searchText" Type="NVarChar" Value="<%$ QueryString: searchValue%>" />
<Parameter Name="intSiteId" Type="Integer" Value="<%$ Application: siteId%>" />
<Parameter Name="intPage" Type=" Integer" Value="<%$ QueryString: page %>" />
<parameter name="intMaxRecords" type="Integer" value='10'></parameter>
<parameter name="enabledEmptyTextSearch" type="Boolean" value='false'></parameter>
<Parameter Name="strContentTypes" Type="NVarChar" Value="Web.Generic-alumni_news,Web.Generic-alumni_insideprosk" />
<headertemplate>
<div class="count">
Your search has turned out <vuture:totalrecordscontrol id="VxTotalRecordsControl" runat="server"></vuture:totalrecordscontrol> results.
</div>
<vuture:searchpager id="Vx605652112123" runat="server" recordsperpage="10" maxpages="10" nexttext="Next" previoustext="Previous"></vuture:searchpager>
</headertemplate>
<itemtemplate>
<div class="result">
<a href='<%# Container.GetPageUrl("", Container["Path"],Container["FileName"], Container["PageType"])%>'><strong><%# Container["PageName"] %></strong></a>
</div>
</itemtemplate>
</vuture:supersnippet>
Advance Site Search by Text , linked pages and published date
Assumption: To search/filter article by published date, the article’s custom field name should be
‘Date Published’
<vuture:supersnippet id="VxSiteSearch" storedprocedurename="usp_Vx_FrontEnd_Advanced_SiteSearch_Results_Get" runat="server" SiteSearchEnabled='true'>
<Parameter Name="searchText" Type="NVarChar" Value="<%$ QueryString: searchValue%>" />
<Parameter Name="intSiteId" Type="Integer" Value="<%$ Application: siteId%>" />
<Parameter Name="linkedIds1" Type="NVarChar" Value="<%$ QueryString: topicId%>" />
<Parameter Name="linkedIds2" Type="NVarChar" Value="<%$ QueryString: officeId%>" />
<Parameter Name="startDate" Type="NVarChar" Value="<%$ QueryString: startDate%>" />
<Parameter Name="endDate" Type="NVarChar" Value="<%$ QueryString: endDate%>" />
<Parameter Name="filterDateFromat" Type=" NVarChar" Value="dd/mm/yyyy" />
<Parameter Name="strContentTypes" Type="NVarChar" Value="Web.Generic-alumni_news,Web.Generic-alumni_insideprosk" />
<Parameter Name="intPage" Type=" Integer" Value="<%$ QueryString: page %>" />
<parameter name="intMaxRecords" type="Integer" value='10'></parameter>
<parameter name="enabledEmptyTextSearch" type="Boolean" value='true'></parameter>
<headertemplate>
Your search has turned out <vuture:totalrecordscontrol id="VxTotalRecordsControl" runat="server"></vuture:totalrecordscontrol> results.
<vuture:searchpager id="VxPaging" runat="server" recordsperpage="10" maxpages="10" nexttext="Next" previoustext="Previous"></vuture:searchpager>
</headertemplate>
<itemtemplate>
<%# Container["PageName"] %>
</itemtemplate>
Advance Site Search by Text , linked pages and published years and months
<vuture:supersnippet id="Vx605652112123" storedprocedurename="usp_Vx_FrontEnd_Advanced_SiteSearch_Results_Get" runat="server" sitesearchenabled='true'>
<parameter name="intSiteId" type="Integer" value=""
<%$ Application: siteId%>"></parameter>
<parameter name="publishedYears" type="NVarChar" value=""
<%$ QueryString: yearIds%>"></parameter>
<parameter name="publishedMonths" type="NVarChar" value=""
<%$ QueryString: monthIds%>"></parameter>
<parameter name="linkedIds1" type="NVarChar" value=""
<%$ QueryString: categoryIds%>"></parameter>
<parameter name="strContentTypes" type="NVarChar" value="Web.{SiteId}-assu_newsitem"></parameter>
<parameter name="intPage" type=" Integer" value=""
<%$ QueryString: page %>"></parameter>
<parameter name="intMaxRecords" type="Integer" value='10'></parameter>
<parameter name="enabledEmptyTextSearch" type="Boolean" value='true'></parameter>
<headertemplate>
<div class="count">
<vuture:totalrecordscontrol id="VxTotalRecordsControl" runat="server"></vuture:totalrecordscontrol> news items Found.
</div>
<vuture:searchpager id="Vx605652112123" runat="server" recordsperpage="10" maxpages="10" nexttext="Next" previoustext="Previous"></vuture:searchpager>
</headertemplate>
<itemtemplate>
</itemtemplate>
</vuture:supersnippet>
Step 5
Enable the search service task in Vx so that the pages are automatically indexed. This is normally done by the Vuture team:
- Find the FullTextSearch task and click Edit
- Set the Task Interval to hour;06:00;2 - this will run every 2 hours
- Retry Enabled can be left as false
- Click Update to save the settings and start the task running
- Navigate to the website you are indexing to set up the site-specific option
- Click on Site Options at the top of the left window
- Click on Configure Search Service
- Set Index on page published: to 'on' or 'off'
- Set Index schedule type to 'Off' or 'On - all pages' or 'On - only pages changed'
- Set Number of Pages to Index to 100
- Set Enable Sending Error Reports to true
- Set Email Interval Start Date to today's date in the format yyyy-mm-dd
- Set Email Interval to Every 1 day
- Set Email Subject to {Name of your Website} Search Service Failure