Using SearchSimon.NET with Index Server to search custom document properties and META tags.
(Windows 2000 Server, Professional, XP, Windows Server 2003)
This tutorial focuses on extending the functionality
of SearchSimon.NET to allow custom document properties to be searched
and displayed within your results page. The example shows how
a "contractno" property from a Microsoft Word document
can be added to a search catalog but the same process could be
used for other document properties and custom META tags in HTML
About ASP.NET Search for Index Server (SearchSimon.NET):
SearchSimon.NET is a search application written
specifically for Microsoft Index Server (Indexing Services)
and the .NET Framework. The application has been designed
to offer as much flexibility as possible whilst remaining
easy to configure and requiring little or no programming knowledge.
1. Custom Document Properties:
For this tutorial, I have created a new Microsoft Word
document which contains a custom document property called
"contractno". To allow us to check the success
of Custom Property search feature of SearchSimon.NET
I have assigned a value of "2004122501JC"
which is very unlikely to appear in other documents
within my Catalog.
Note: You can also search custom META tag properties
of HTML documents such as the following:
2. Rescanning your Catalog:
Once the document has been added, the Catalog will need
to be completely rescanned. This process allows new
properties (including "contractno") to be
picked up by the Indexing Service and added to the catalog.
To rebuild the catalog, first stop the Indexing Service
and then delete the appropriate "catalog.wci"
file as shown above. Then, restart the Indexing Service.
It may take several minutes for the catalog to fully
Note: There are other methods which can be used to
rebuild your catalog. However, I have found that this
is by far the most reliable.
3. Catalog Properties:
Once the Indexing Service has finished rebuilding the
catalog, you will notice that a new entry has appeared
in your Catalog "Properties" list (as shown
Note: You may need to right-click on "Properties"
and select "All Tasks", "Refresh List"
for the new property to appear.
Right-click on the new entry and select "Properties"
to open the Property Dialog box.
4. Property Dialog box:
In order for the "contractno" property values
to appear within your results page, you need to check
the "Cached" checkbox as shown above. The
Indexing Service will attempt to detect the correct
values for the other options within the dialog box so
it's usually okay to leave them as they are.
Make a note of the values for Property Set and Property
as displayed in your Property Dialog box. Shown below
are the corresponding values from the dialog box above.
We will need these values later.
Click "OK" to save the changes and click
"OK" on the "Pending Change" popup
5. Rescanning your Search Directories:
You will need to completely rebuild your catalog again
to allow the Indexing Service to index the values for
the "contractno" custom document property.
To do this, stop the Indexing Service, manually delete
the appropriate "catalog.wci" file and restart
the Indexing Service as in step 2. Again, this process
may take several minutes.
6. Configuring SearchSimon.NET
to search custom document properties:
Open "web.config" with Notepad (or your preferred
text editor) and locate the "customfields"
key as shown above.
This key can consist of as many custom
document properties as you require. Each property "group"
should be separated with a comma and the items within
the "group" with a | (known as a "Pipe").
The format for one property "group" should
consist of the following:
The "Datatype" defines the type
of data stored within the Property. In almost all cases
this will be a simple string (DBTYPE_WSTR) so, using
the values from Step 4 we get:
If you need to index multiple custom
properties, separate each property "group"
with a comma.
7. Configuring SearchSimon.NET to allow users to choose custom document properties:
You may want to add a selection to the "Properties"
list within the SearchSimon.NET search page which will
allow users to ONLY search your custom document properties
(as shown above). To do this, simply open "web.config"
and find the "Searchlist" key. Each selection
is contained within a comma delimited list and contains
a "Friendly" name and corresponding field
name separated by a Pipe.
So, the format is as follows:
Field A|customfielda,My Field B|customfieldb
Simply append the appropriate values to
the end of the "Searchlist" key, making sure
to include the delimiting comma and pipe in the correct
place (also shown above). In our case, this is:
8. Configuring SearchSimon.NET to show your custom document properties on the results page:
The results page can be easily modified to suit your
requirements. Simply open "default.aspx" with
Notepad and locate the "GetAuthor" line. You
should then add an entry for your custom property as
shown above. The format for this, should match the following:
<display name> <%# DataBinder.Eval(Container.DataItem,
So, in this case the line to be added should read:
Contract No: <%# DataBinder.Eval(Container.DataItem,