Testing Your Gateway Driver


This section shows a basic test that you can perform on your gateway using the mkvdk and rcvdk commands. The following initial directory structure, where install_dir is the directory in which K2 is installed, is assumed:

>cd /install_dir/k2/samples/client/c/GDK/vgwsamp
>ls
total 5
drwxr-xr-x 2 user 512 Mar 22 14:22 bif
drwxr-xr-x 11 user 512 Mar 8 19:44 coll1
drwxr-xr-x 4 user 512 Mar 22 17:29 src
drwxr-xr-x 2 user 512 Mar 8 19:44 style
drwxr-xr-x 2 user 512 Mar 8 19:44 testdocs

Create a collection named c1:

 

mkvdk -collection c1 -create -style style

mkvdk - Verity, Inc. Version 4.5.0 (_ssol26, Mar 7 2002)
mkvdk done

Add to the collection, specifying user abc with password def and using bulk insert:

 

mkvdk -collection c1 -credentials abc:def -bulk bif/bulk.bif
mkvdk - Verity, Inc. Version 4.5.0 (_ssol26, Mar 7 2002)

BulkInserting into c1 (1) from bif/bulk.bif (0, 0)
Initializing dataset 00000001.ddd, index 00000001.did
Totals (3 documents): 60 para 153 sent 2778 word (1392 Kb used)
Optimizing database layout
(4504 ms) Indexed 3 docs into c1/parts/00000001
Writing partition index data
mkvdk done

 

   
  Note   You will need to create a bulk insert file (BIF) from a “crawler” application, such as the fscrawl utility. For more information, see Creating a Bulk Insert File.
   

 

Attach the collection:

 

rcvdk c1

rcvdk Verity, Inc. Version 4.5.0
Attaching to collection: c1
Successfully attached to 1 collection.
Type 'help' for a list of commands.

Attempt to search for all documents, without authentication:

 

RC> s
Search update: finished (100%). Retrieved: 0(0)/3.

Provide credentials and authenticate: (The sample gateway is user abc with password def.)

 

RC> u
login ID [VGDK Sample : abc]:abc
password: ***
domain:

Attempt to search for all documents, with authentication:

 

RC> s
Search update: finished (100%). Retrieved: 3(3)/3.

List results set:

 

RC> r
Retrieved: 3(3)/3
Number SCORE VdkVgwKey
1: samp://servern/repo_dirn/docn
2: samp://server2/repo_dir2/doc100
3: samp://server1/repo_dir1/doc1

 

   
  Note   The protocol, such as samp in this example, determines the gateway driver that will handle the bulk insert. For more information, see Creating Document Keys.
   

 

Restrict the search:

 

RC> s the
Search update: finished (100%). Retrieved: 3(3)/3.
RC> s Verity
Search update: finished (100%). Retrieved: 3(3)/3.

View some results:

 

RC> v 1

Quit:

 

RC> q