User Guide

134 Chapter 10: Searching Collections with K2 Server
To edit the k2server.ini file:
1 Open the k2server.ini file in your text editor.
Tip: Use your text editor’s search function to locate the appropriate code. For example, to locate
the settings for the port number, as described in the next step of this procedure, search for
portNo=.
Note: If you did not install ColdFusion MX into the default directory, edit the paths in this
procedure to reflect the appropriate directories.
2 In the code for portNo=, verify that the value matches the value for the K2 Server port. The
default value is 9901:
##portNo: TCP port number for client connections.
portNo=9901
3 (Required only if you run K2 Server as a Windows service) In the code for vdkHome=, verify
that the value matches the location of the Verity common directory. This is the
cf_root\lib\common directory in Windows, and is the cf_root/lib/common directory on UNIX.
## vdkHome: directory containing Verity resources (common directory)
- need it running as an NT service
## vdkHome=c:/cfusionmx/lib/common
Note: If you run K2 Server as a Windows NT service, you must remove the pound signs (##) in the
highlighted line above to uncomment the code. If the line remains as a comment, K2 Server will not
execute correctly.
4 In the code for [Coll-0], specify in the collPath parameter the directory of a collection that K2
Server will search:
[Coll-0]
collPath=c:\cfusionmx\verity\collections\test_01\file
collAlias=test_01_file
The collPath value must point to an existing Verity collection; the k2server executable cannot
be used to create a collection.
Note: The final subdirectory for your collPath might differ, based on whether it is an external
collection (that is, a native Verity tool created it) or ColdFusion MX created it. If ColdFusion MX
created the collection, there are file and custom subdirectories; these subdirectories are not
present in external collections. For more information, see “Collection structure and ColdFusion
MX” on page 86.
5 In the next line, specify a collection alias in the collAlias parameter:
[Coll-0]
collPath=c:\cfusionmx\verity\collections\test_01\file
collAlias=test_01_file
You use this value to reference the collection in CFML.
Note: Collection alias values must be unique. They must be different from any collection names
managed by ColdFusion MX.
The following CFML code performs a K2 mode search on the test_01_file collection:
<cfsearch
collection="test_01_file"
name="getData"
criteria="#form.criteria#">