Query Commands

search  -query <query-str> -table <name> [-fields <field1,field2,...>]

The search command allows you to run a simple query against an existing table.

 

query-str

is the string to be matched.

name

is the name of the table to be searched.

Field1,field2,...

is a comma separated list of the fields with the table to be searched.  All of the named fields must be searchable text fields in the table.  If this is not given all searchable text fields in the table are searched.

querygen

The querygen command is a search query generation tool that creates a sample Java class file. The class file produced will contain 3 different query types; “Simple”, “And”, and “Cognate”.  The class file is fully runnable after being compiled, but in most cases, modification will be desired and in some cases where input columns do not match with the table in the matching engine, required. Once the class file is created you can run the class file as  a standalone program or if you want to feed the compiled executable jar file queries from the command line, use the “-cli” argument. Within the generated class file you may specify the output to create a HL page with color coded output or a CSV file.  To specify the output format, within the generated class file, change the output file extension as documented in the generated java file. When issuing the querygen command, the output file location should be specified using double backslashes, “\\”.

The quergen command can also be used to run batch matches by using the “-batchfile” argument. If the columns in the batch input file do not match, some manipulation of the variables “data[n]” will be required in the generated Java class file.

If using the –cli option, you will need the Apache Commons CLI Java jar files to compile.

-cmd querygen  -table <table> [-name <name>] [-file <file(use \\>] [-cli] [-batchfile <input file>]

Examples of NSC querygen calls:

Regular:

-cmd querygen -table names -file c:\\dev\\ -name java_sample

CLI:

-cmd querygen -table names -file c:\\dev\\ -cli

Batch File:

-cmd querygen -table names -batchfile c:\\data\\names.csv -file c:\\dev\\