Introduction
The document indexer service
is a Windows Service that reads documents residing in a customer’s share
(Normally CV data) and places the contents into the database so that SQL Server
can index them.
The service is designed to
index multiple databases on a given server. In order to do this the database
must contain information about the location of the documents to be indexed.
This is achieved via a new system setting that specifies the location of the
share for a given database. This is detailed in the next section.
In summary the application
essentially goes through the following life cycle:
1) Service is started, polling time is read from the
Config file.
2) Waits for X minutes as specified in the polling time.
3) Connects to the server specified in the Config file.
4) For each TriSys database on the server:
a.
Check if the share is specified. If
not skip the DB.
b.
Index the documents in the share.
c.
Update the database logging the
outcome of the index.
5) Sleep until the next poll is due.
In order to install and
configure the service there are two primary areas. Firstly the service itself
needs to be set up and secondly any databases that it is going to index needs
to have certain settings applied. These two steps are distinct because in an
environment with multiple databases the service only needs to be configured
once where as each database must be done as it is added.
Please note that
when adding a new ASP customer to an existing server you should just
have to complete this section as the indexer will automatically pick up the new
database.
The first thing to
do is to set the share location in the TriSys database. In order to do this
open the TriSys V7 Application and log in as the SuperUser. Then go to
Application Properties and add or locate the following entry:

This needs to be
set to the root of the share for the database. (“\\MyServer\TriSys” points to
the root of the customer’s share (G drive), for example \\TriSys-NAS-D01\OpusLaborus$)
If the customer is
using a drive other than G as the mapped drive from the client machines then
another entry needs to be made/updated in order to tell the indexer which drive
letter is being used. If this setting is not present then G will be assumed as
the default.

In order to install this
product run the MSI and leave all of the options at default unless you need to
install to another location. However the size of the install is very small
(approx 10mb) therefore I can’t see this being an issue:

During the install you will be
prompted to enter the account credentials for the Windows account that the
service will run under. Note that this is not a true modal dialog for some
reason and therefore can get lost behind another window.

The account specified must
have access to ALL of the customer shares that are to be indexed. In client
server installs this will just be one, where as in ASP environments it may be
every customer.
Once the install is completed
you manually need to tell the application which server it is connecting to. In
order to do this open the “DocumentIndexerService.exe.config”
file which will be in the install directory (c:\Program Files\TriSys\Document
Indexer by default).

The line above must be edited
by replacing the “MY_SERVER” string with the name of the SQL Server instance
and the “MY_PASSWORD” string with the Sa account password. For example:
If necessary you can also
alter the indexing frequency which is set in this config file, adjust this as
necessary:

Once this has been completed
the service needs to be started. In order to do this open the services console
by going to Administrative Tools and opening Services (Normally
Start->Control Panel->Administrative Tools->Services).

Right click the service and
choose start.
The service will
log entries to the Windows Event Log under the applications category:

As described in the
introduction the service generally has the following life cycle and each of
these items will normally write something to the event log (examples shown in
blue):
1) Service is started; polling time is read from the
Config file.
Service
started successfully.
2) Waits for X minutes as specified in the polling time.
Countdown
started, frequency 30 minute(s).
3) Connects to the server specified in the Config file.
Countdown
completed, initiating process.
-
Processing server: Server=Trisys-sql-02\SQL2005;Database=Master;UID=sa;Password=p1ng994ever;
4) For each database TriSys database on the server:
a.
Check if the share is specified. If
not skip the DB.
TriSysV7Master - Invalid settings
specified. Root Dir: , Mapped Drive: G:\, Sub Dirs
System.Collections.Generic.List`1[System.String].
b.
Index the documents in the share.
TriSys705_ReleaseCandidate - Document
indexing completed successfully on datastore: TriSysCore.Datastore
TRISYS-SQL-02\SQL2005.TriSys705_ReleaseCandidate. 689 file(s) scanned, 0
file(s) updated, 11 file(s) ignored based upon file type, unable to index 0
file(s), 0 file(s) removed from the index because they were not found.
c.
Update the database logging the
outcome of the index.
(Just
updates the individual DB).
5) Sleep until the next poll is due.
-
Processed server: Server=Trisys-sql-02\SQL2005;Database=Master;UID=sa;Password=
p1ng994ever;
Countdown
started, frequency 30 minute(s).
In addition to
these entries in the event log the application also saves historical details to
two other locations. One is in a log file placed in the share for each database
indexed in a directory named “Service Logs”:

In the case of this
service the log will be named “DocumentIndexer.log” and will contain details of
the last index attempt for this database. For example:
23 Jun 2008
09:15:00 TriSys705_ReleaseCandidate - Commencing Index
23 Jun 2008
09:15:01 TriSys705_ReleaseCandidate - Validating directory:
\\TriSys-Nas-02\V7DemoData\CVData
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - Retrieving file list from:
\\TriSys-Nas-02\V7DemoData\CVData\1
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - Processing file:
\\TriSys-Nas-02\V7DemoData\CVData\1\123123_1_049480.doc
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - File has not been modified since last
index \\TriSys-Nas-02\V7DemoData\CVData\1\123123_1_049480.doc
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - Processing file:
\\TriSys-Nas-02\V7DemoData\CVData\1\123_T_049486.doc
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - File has not been modified since last
index \\TriSys-Nas-02\V7DemoData\CVData\1\123_T_049486.doc
23 Jun 2008 09:15:02
TriSys705_ReleaseCandidate - Processing file:
\\TriSys-Nas-02\V7DemoData\CVData\1\_123_F_087802.doc
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - File has not been modified since last
index \\TriSys-Nas-02\V7DemoData\CVData\1\_123_F_087802.doc
23 Jun 2008
09:15:02 TriSys705_ReleaseCandidate - Retrieving file list from:
\\TriSys-Nas-02\V7DemoData\CVData\9
23 Jun 2008
09:15:03 TriSys705_ReleaseCandidate - Processing file:
\\TriSys-Nas-02\V7DemoData\CVData\9\99_T_049473.doc
Finally the outcome
of the last index and the time it completed will be placed in the following
system setting in the database:

In order to remove
the service simply go to the “Add/Remove Programs” or “Programs and Features”
option under control panel, find the “Document Indexer” entry in the list of
programs and click “Remove”:

In general if a
database does not appear to be getting indexed correctly you need to check the
following points in this order:
1)
Is the service running?
2)
Is it indexing the
correct server? (Check the Config file and the event log).
3)
Does the DB contain the correct
share settings? (Check the DB and the event log).
4)
Check the outcome of the
last index.
In most cases so
far the problems have generally been down to the settings being incorrect or
missing from the database. Errors such as this can be seen in the event log.