VERIFIED SOLUTION i

How to set up Custom Indexes

5.3m5
How do I set up custom indexes, so that I can search on things other than the default name, address, account, etc?

Custom indexing
The search options that are presented when
retrieving documents from the Vault can be
customized to suit your application requirements.
Extra indexes can also be added to those already
provided. This will give extra search options when
accessing the Vault. Refer to your e2 supplier for this
and other indexing options.
Changing the search options
The search option labels that are listed in the Service
Client and the Service Web can be changed from the
defaults of:
Account numbers
Names
Addresses
Dates under this account
All the index entries must be defined in an
initialization file, and the label changed as required.
Use the database initialization file for system wide
changes or the profiles initialization file for a
particular profile(s) only. You must ensure that all
the index entries are defined, as when indexes are
defined in the initialization file, no defaults are
assumed; otherwise the default settings are used
exclusively. Note that there are also some extra
internal index entries that must also be included.
| To change the search list options:
1. Enable custom indexing.
In profiles.ini, set the CustomIndexing=1
keyword.
2. Define the indexes.
Add all the index entries as follows, defining the
search list label as required. Refer to the section
that follows for full details.
3. Update initialization files.
Ensure that any changes you have made to the
database.ini and profile initialization files are
propagated to all other instances of the files. See
“Render entry format example” on page 119
 
Index entry format example
Index<N>=<indexfilename>,<keyfield>,<flags>,<label>
Index1=account,cust.account,wjctul,label
Index2=name,cust.name,jcrtul,label
Index3=address,cust.address,jcrtul,label
Index4=invlink,hint.date,dhasb,label this is the date search option
Index5=guid,hint.guid+int.null+hint.type,dhi,GUID this is used internally
where:
label is the text to be shown in the search list for that index.
The index numbers must be sequential starting at '1'. a missing number indicates the end of the indexes; any
subsequent indexes will not be used.
Render entry format example
Render<N>=<title1>;<title2>;<title3>,<field1>;<field2>;<field3>
Example database.ini entries:
Index1=account,cust.account,jctul,Accounts
Index2=name,cust.name,jcrtul,Names
Index3=address,cust.address,jcrtul,Addresses
Index4=guid,hint.guid+int.null+int.format,dhi,GUID
Index5=contract,hint.invoice,dh,Invoice Numbers
Index6=wayg,WAY,dh,Way Bills
Index7=invlink,hint.date,dhasb,Dates under this account
Index8=pol,PO,sadh,Purchase Order under this account
Index9=ordl,ORD,sadh,Order Number under this account
Render1=Customer;Name;Location,cust.account;cust.name;cust.address
Render2=Name;Customer;Location,cust.name;cust.account;cust.address
Render3=Location;Customer;Name,int.match;cust.account;cust.name
Render4=GUID;Customer;Date,hint.guid;hint.account;hint.date
Render5=Invoice Number;Customer;Date,hint.invoice;hint.account;hint.date
Render6=Way Bill;Customer;Date,WAY;hint.account;hint.date
Render7=Date;Invoice,hint.date;hint.invoice
Render8=Purchase Order;Date,PO;hint.date
Render9=Order Number;Date,ORD;hint.date
 
Index Flag Descriptions
Flags Internal Variable Description
a PrefixAccount Prefixes the user's search key with
[account][0]. This index is used to search
for data associated with a particular
account (document names, and purchase
orders).
m MultipleValues Add multiple keys if more than one copy
of the attribute is present. When adding
keys based on custom attributes, look for
multiple copies of that attribute and add
each one separately. NOTE: The
maximum number of multiple instances is
limited by the following profile setting
(default is 8):
[profilename]
MaxInstances=4
s AccountMustBeSelected This flag tells the client that an account
must be selected in order for the search to
appear in the list of available searches.
h LinkByHintRecord Match ends with [0][hintfile
name][0][hintfile offset].The keys in this
index point to documents.
c LinkByCustomerRecord The keys in this index point to accounts.
Match ends with [account.drr offset].
p DisplayPage If the index points to a document using a
custom attribute, switch to the page
associated with that attribute.
d DisplayDocument When selected, display the first page of
the specified document.
t DisplayNewestDocument Displays the most recent document for
the account (whether the index points to a
document or account
 
r RotateStrings Adds multiple “rotations” of the key field to
the index, each version starting at a new
word within the value. For example field
“JOHN SMITH” would add versions
“JOHN SMITH” and “SMITH JOHN”. This
can be used to search within a key field
which is useful for names and addresses.
In a name index for example you could
search for first or last name. NOTE: The
maximum number of rotated values
(option r) is limited by the following profile
setting (the default is 8):
[profilename]
MaxRotations=4
b SearchBackwards Shows the search results in reverse order
(helpful for the date index - it will show
most recent first).
i InvisibleToUser Sets the index as invisible to the user.
u UpdateOnCustomer Add this key only if the customer record
changes. This is an optimization for fields
that use the customer record, it avoids the
effort if it did not change).
l LeaveOnUnindex Do not remove this key when the print file
removed from the Vault (fields that point
to the customer record should still be
usable when a single print file is
removed).
j JumpOnSingleMatch If a single search value was returned,
automatically select it (if you enter a
unique matching search, that result will
immediately pop up, otherwise it will wait
for the user to click on the single result
listed).
w WebAccountIndex Web scripts can use this index to check
the existence of accounts (this is used
sometimes by custom web scripts that
need to know which index will tell them
whether an account number is valid).
 
Flag Scenarios
Below is an example of possible scenarios that can be
created with the use of multiple flags:
Top level index that points to an account (name,
account, and address)
ctul
• points to a customer
• shows the most recent document when selected
• add only if the customer record changed
• leave this key when documents are removed
• use only cust.xxx fields
Top level index that points to a document (invoice
number and purchase order)
hd
• points to a document
• shows this document when selected
• uses only doc.xxx fields or custom attributes
An index that points to documents under an
account (dates under this account, invoice numbers
for this account)
hdsa
• points to document
• shows this document when selected
• an account must be selected before the search
should be available
• the key's value is associated with a specific
account
• uses only doc.xxx fields or custom attributes
Common Options
Below are examples of options that are commonly
used for indexing.
b – List backwards: shows the results in backwards
order.
j – Autoselect: automatically select the match when
only one matching result is found.
r – Search within the field: add “rotated” versions
(e.g. JOHN SMITH would add “JOHN SMITH”
and “SMITH JOHN”).
Uncommon Options
Below are examples of options that are not
commonly used for indexing but can be used if
deemed necessary.
i – Do not show this to the user: this index is
invisible to the user.
m – Multiple values of a custom attribute: add each
specified copy of the custom attribute to the index.
w – Mark this as the account index for web scripts:
marks the index that can be used by web scripts to
validate account numbers.
Multi database Support for Extended
Indexing
Index entries can be put in a separate database.
Separate databases are implemented as
sub-directories of Server\Index. You can also use
Database=dbname or Database=dbname1,
dbname2, or Database=* in the profile.
If indexfilename has a database\filename form, then
use this database
Database Suboptions
profiles.ini on server:
To indicate the use of a default database:
[section]
To indicate the use of a single database:
[section]

  
UPDATED:  August 23, 2017