UltimateSearch Tutorial

1. Getting Started
2. Adding controls to your page
3. Indexing your web application
4. Using the Admin page
5. Updating the Config file
6. Displaying search results
7. Renaming the Admin directory
8. Automatic indexing options
9. Indexing PDF, DOC, and more
10. Passing querystring parameters to the Admin page

1. Getting Started

1. Copy UltimateSearchInclude and UltimateSpellInclude directories from C:\Inetpub\wwwroot\Karamasoft\ASP.NET3.5\UltimateSearch\v3.3\Controls to the root of your web application.

2. Give full permission to the local "NETWORK SERVICE" user (ASPNET user in Windows XP) on the Index and Log directories under the UltimateSearchInclude directory of your web application so that it can save index and log files properly. Open Windows Explorer, right-click "YourApplication\UltimateSearchInclude\Index" directory, select "Properties" and click the Security tab.

If you don't see the Security tab in Windows XP, open Windows Explorer, and choose Folder Options from the Tools menu. On the View tab, scroll to the bottom of the Advanced Settings, clear the check box next to "Use Simple File Sharing", click OK to apply the change, and you should now have a Security tab when viewing the properties of a file on an NTFS volume.

Select your machine in the "Look in" dropdown box. Click the "Add..." button. Add NETWORK SERVICE (ASPNET in Windows XP) by double-clicking on it and click OK. In the "Permissions" section, allow "Full Control" permissions and click OK.

Now follow the same steps on the Log directory.

Back to Top

2. Adding controls to your page
UltimateSearchInput and UltimateSearchOutput icons are automatically added to the Web Forms toolbox during installation. If you don't see those icons see section (a) below. If you don't use Visual Studio see section (b) below.

1. Drag-and-drop UltimateSearchInput control into a web form.
2. Drag-and-drop UltimateSearchOutput control into the same web form.

a) Adding UltimateSearch into Visual Studio Toolbox

1. Select Web Forms tab in Visual Studio Toolbox.
2. From Tools menu, select Add/Remove Toolbox Items.
3. Select .NET Framework Components tab, click Browse, and select C:\Inetpub\wwwroot\Karamasoft\ASP.NET3.5\UltimateSearch\v3.3\Controls\bin\UltimateSearch.dll.

b) Adding UltimateSearch into your project without Visual Studio

1. Copy C:\Inetpub\wwwroot\Karamasoft\ASP.NET3.5\UltimateSearch\v3.3\Controls\bin\UltimateSearch.dll to the bin folder of your application.
2. Add the following register to the top of your aspx page:
    <%@ Register TagPrefix="cc1" Namespace="Karamasoft.WebControls.UltimateSearch" Assembly="UltimateSearch" %>
3. Add the UltimateSearch controls into your web form as follows:
    <cc1:UltimateSearchInput id="UltimateSearchInput1" runat="server"></cc1:UltimateSearchInput>
    <cc1:UltimateSearchOutput id="UltimateSearchOutput1" runat="server"></cc1:UltimateSearchOutput>

Back to Top
3. Indexing your web application
After building and running your web application, open http://localhost/YourWebApp/UltimateSearchInclude/Admin/UltimateSearch.admin.aspx in Internet Explorer. You will see several links to manage your application. You can index your application, or display the indexed pages and words using this interface.

Note that you may index your application either manually by clicking the related links on the Admin page, or automatically. Indexing will be done based on your configuration settings in the Config file.

Back to Top
4. Using the Admin page
UltimateSearch.admin.aspx page under the UltimateSearchInclude/Admin directory allows you to manage your indexing manually. You can index everything from scratch, or index only the changed pages. You can add or remove urls to the current index. Your website will still be able to provide search functionality while indexing is in process. You can also display indexed pages and words.

Read the Admin document to learn more about these settings.

Back to Top
5. Updating the Config file
UltimateSearch.config file under the UltimateSearchInclude directory of your web application lets you configure all the parameters to customize the indexing process. You can specify which directories to scan and index, what type of documents to index, how to score keywords based on their positions, and much more. You can update the Config file in Visual Studio, Notepad, or any other editor of your choice. It has an XML format just like the Web.config file.

Read the Config document to learn more about these settings.

Back to Top
6. Displaying search results
As a common practice you should have the UltimateSearchInput control on all pages either inside a user control, or inside a header include file so that the user can make a search from all pages in your website. However, you would normally have only one page to display the search results, and you should have an UltimateSearchOutput control on that page only. To display the search results on this particular page regardless of where the search is submitted from, you should set the SearchOutputPage property of the UltimateSearchInput control to the url of the search results page that has the UltimateSearchOutput control on it.

Back to Top
7. Renaming the Admin directory
If you have a public website it would be a good idea to rename YourApplication\UltimateSearchInclude\Admin directory such as YourHiddenAdmin so that only the administrative personnel can open this page.

Back to Top
8. Automatic indexing options
You can automatically index your web application in one of the following ways:

Windows Scheduled Task: If you want to index your website at specified times, you can create a Windows scheduled task. Go to Control Panel -> Administrative Tools -> Task Scheduler (or Scheduled Tasks based Windows OS) and select Create Basic Task (or Add New Task based Windows OS). Enter task name and specify trigger and schedule. Set the program to run as below:

"C:\Program Files\Internet Explorer\iexplore.exe" http://localhost/Karamasoft/ASP.NET3.5/UltimateSearch/v3.3/Demos/CS/UltimateSearchInclude/Admin/UltimateSearch.admin.aspx?cmd=IndexFull

It will open an Internet Explorer browser window, open the Admin page and pass a querystring parameter such as "IndexFull" in order run full indexing. You can change the querystring parameter based on your needs. Check out the querystring parameters that you can pass into the Admin page.

Windows Forms Application: If you want to index your website based on a file dependency, you can use the provided application under C:\inetpub\wwwroot\Karamasoft\ASP.NET3.5\UltimateSearch\v3.3\Controls\Documents\FileDependencyApp. You will be able to run indexing whenever a file gets modified, created, renamed or deleted. This program comes with full source code, and you can customize it per your own needs. You will at least need to change the "FileWatchPath" and "AdminCommandUrl" settings in the "bin\Debug\FileDependencyApp.exe.config" file for your own app.

It will open an Internet Explorer browser window, open the Admin page and pass a querystring parameter such as "IndexIncremental" in order to run incremental indexing. You can change the querystring parameter based on your needs. Check out the querystring parameters that you can pass into the Admin page.

UltimateSearch API: If you want to index your website programmatically from inside your web application, you can call the public methods (IndexFull, IndexIncremental, etc.) of the UltimateSearchOutput control. Check out the Server API document to learn more.

Back to Top
9. Indexing PDF, DOC, and more
If you want to index documents such as PDF, DOC, PPT, and so on, you can add those file extensions to the "includeFileTypeList" in the Config file. UltimateSearch reads Microsoft Office documents with the help of the Ifilters that already exist on Windows machines. UltimateSearch has a built-in parser to read the PDF files. However, if you experience any issues with it and want to use Adobe IFilter, you can download it from Adobe website, install it on your machine and set the "useIfilterToParsePdf" flag to "true" in the Config file.

Back to Top
10. Passing querystring parameters to the Admin page
You can set the querystring parameter "cmd" to one of the following values in order to run indexing without having to click a button on the Admin page:

   IndexFull, IndexIncremental, StopIndexing, CancelIndexing, LoadCopiedIndex, DeleteIndex, DisplayIndexedPages, DisplayIndexedWords

For example:

   http://localhost/Karamasoft/ASP.NET3.5/UltimateSearch/v3.3/Demos/CS/UltimateSearchInclude/Admin/UltimateSearch.admin.aspx?cmd=IndexFull

Read the Admin document to learn more about these commands.

Back to Top