ibi Patterns .NET API
Loading...
Searching...
No Matches
NetricsServerInterface.NetricsServerInterface Class Reference

Base class for all interactions with the ibi™ Patterns - Search Server. More...

Public Types

enum  ConnectionPoolingPolicy { None , Local , Shared }
 Possible connection pooling policies. More...
 
enum  ShutdownStatus { Initiated = 0 , Complete = 1 }
 Shutdown the ibi™ Patterns - Search Server. More...
 

Public Member Functions

 NetricsServerInterface (String host, int port)
 
 NetricsServerInterface (String host, int port, int encodingNum)
 
 NetricsServerInterface (String host, int port, bool debug)
 Set debug to true to print socket output to stdout.
 
bool DebuggingOn ()
 Turn on socket protocol debugging output.
 
bool DebuggingOff ()
 Turn off socket protocol debugging output.
 
void selectLayout (String layout)
 Obsolete. Layouts are deprecated since version 5.6, and removed in 5.7. This function has no effect.
 
String getLayout ()
 Obsolete. Layouts are deprecated since version 5.6, and removed in 5.7. This function always returns null.
 
bool ParseDebuggingOn ()
 Turn on response parsing debugging output.
 
bool ParseDebuggingOff ()
 Turn off response parsing debugging output.
 
ConnectionPoolingPolicy getConnectionPoolingPolicy ()
 Get the current connection pooling policy.
Default is ConnectionPoolingPolicy.Shared.
 
void setConnectionPoolingPolicy (ConnectionPoolingPolicy policy)
 Changes the connection pooling policy for this NetricsServerInterface object.
Use of this function is not generally recommended.
 
NetricsTableStats tblload (NetricsTable tbl)
 Used to load a NetricsTable into the server.
 
NetricsTableStats tblload (NetricsTable tbl, bool doMaxWork)
 Used to load a NetricsTable into the server.
 
NetricsTableStats tblload (NetricsTable tbl, NetricsRecFile fileDef)
 Create and load a table from a server side CSV file.
 
NetricsTableStats addRecsFromFile (String tblName, bool replaceNotAdd, NetricsRecFile fileDef)
 Add or replace records from a file.
 
NetricsTableStats updRecsFromFile (String tblName, NetricsRecFile fileDef)
 Update records from a server side file.
 
void thcreate (NetricsThesaurus thes)
 Create a thesaurus in the ibi™ Patterns - Search Server.
 
void cthcreate (NetricsCombinedThesaurus cthes)
 Create a combined thesaurus in the ibi™ Patterns - Search Server.
 
void cmapcreate (NetricsCharmap cmap)
 Create a character map in the ibi™ Patterns - Search Server.
 
String[] cmaplist ()
 Lists the character maps currently loaded in the ibi™ Patterns - Search Server.
 
NetricsCharmap cmapget (String name)
 Gets the content of a character-map.
 
NetricsCharmapStats[] cmap_stats (String[] cmap_names)
 Lists statistics on character maps currently loaded on the server.
 
void wdcreate (NetricsWeightedDictionary wdict)
 Create a weighted dictionary in the ibi™ Patterns - Search Server.
 
void rlcreate (String rlModelName, String rlModelFile)
 Create a learning engine model in the server.
 
void rlcreate_l (String rlModelName, String rlModelFile, bool allowLargeGatewayMem)
 Create a learning engine model in the server.
 
void rlcreate_l (String rlModelName, String rlModelFile)
 Like rlcreate_l(rlModelName, rlModelFile, bool), except the gateway model-in-memory flag is left at the server default (currently false).
 
NetricsModelStats[] rllist (String[] modellist)
 List information on ibi™ Patterns - Search Learn Models.
 
void rldelete (String[] modellist)
 Delete one or more ibi™ Patterns - Search Learn Models.
 
double rleval (String rlModelName, double[] featurevec)
 Evaluate an ibi™ Patterns - Search Learn Model with the given vector of feature values.
 
NetricsSearchResponse search (NetricsSearchCfg cfg, NetricsSearchOpts opts)
 Version of search to search a single table.
 
NetricsSearchResponse search (NetricsSearchCfg[] tblCfgs, NetricsSearchOpts opts)
 Perform a search.
 
NetricsSearchResponse scoreRecords (NetricsQuery query, NetricsSearchOpts query_opts, NetricsTable rec_format, params NetricsRecord[] records)
 Score one or more records against a query.
 
NetricsSearchResponse scoreRecords (NetricsQuery query, NetricsSearchOpts query_opts, NetricsTable rec_format, NetricsTableRecSrc rec_src)
 Score all records from a record source against a query.
 
NetricsTableStats[] list (String[] tblnames, bool includeVarAttrNames)
 Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
 
NetricsTableStats[] list (String[] tblnames)
 Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
 
NetricsIdxStats[] idxlist (String[] tblnames)
 Lists statistics for partitioned indexes.
 
void thdelete (String[] theslist)
 Delete one or more thesauri currently loaded on the server.
 
String[] thlist ()
 Lists the thesauruses currently loaded in the ibi™ Patterns - Search Server.
 
NetricsThesStats[] thes_stats (String[] thes_names)
 Lists statistics on thesauri currently loaded on the server.
 
void tblmove (String oldName, String newName)
 Rename a table.
 
void tbldelete (String tblName)
 Delete a table.
 
NetricsRecord[] recget (String tblName, String[] recKeys)
 Get multiple records from a table.
 
NetricsRecord recget (String tblName, String recKey)
 Get a single record from a table.
 
NetricsRecord getChildRecord (String table_name, String parent_key, String child_key)
 See getChildRecords(string,string[],string[])
 
NetricsRecord[] getChildRecords (String table_name, String[] parent_keys, String[] child_keys)
 Get multiple records from a child table.
 
NetricsRecord[] getChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys)
 Get multiple records from a child table.
 
NetricsRecord[] getChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys, bool do_max_work)
 Get multiple records from a child table.
 
NetricsTableStats delChildRecord (String table_name, String parent_key, String child_key, bool doMaxWork)
 
NetricsTableStats delChildRecords (String table_name, String[] parent_keys, String[] child_keys, bool doMaxWork)
 Delete multiple records from a child table.
 
NetricsTableStats delChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys, bool doMaxWork)
 Delete multiple records from a child table.
 
NetricsCompoundRecord[] getCompoundRecords (String parent_table, String[] child_tables, params String[] parent_keys)
 Get multiple compound records.
 
NetricsTableStats recadd (String tblName, NetricsTableRecSrc src, bool doMaxWork, int estNumRecs)
 Add records to a table.
 
NetricsTableStats recadd (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 recadd with no lock key or estimated number of record.
 
NetricsTableStats recadd (String tblName, NetricsRecord rec)
 Add a single record to a table.
 
NetricsTableStats recdelete (String tblName, String[] recKeys, bool doMaxWork)
 Delete records from a table.
 
NetricsTableStats recdelete (String tblName, String recKey)
 Delete a single record from a table.
 
NetricsTableStats[] delCompoundRecords (String parent_table, String[] child_tables, String[] parent_keys, bool delete_orphans, bool doMaxWork)
 Deletes a set of records from a parent table, and deletes associated child records from child tables.
 
NetricsTableStats recupdate (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 Update records in a table.
 
String[] checkpoint (String[] tblnames)
 Checkpoint tables currently loaded in ibi Patterns - Search Engine. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsObjectNameCollection checkpointObjects (NetricsObjectNameCollection objects)
 Checkpoint objects (tables, thesauri, character maps, rlink models) currently loaded in the ibi™ Patterns - Search Server. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
String[] restore (String[] tblnames)
 Restore tables previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsObjectNameCollection restoreObjects (NetricsObjectNameCollection objects)
 Restore objects previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsTableStats recreplace (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 Replace records in a table.
 
NetricsTableStats recreplace (String tblName, NetricsRecord rec)
 Replace a single existing record in a table.
 
NetricsTableStats recupdate (String tblName, NetricsRecord rec)
 Update a single existing record in a table.
 
NetricsTableStats doRecOps (String table_name, bool do_max_work, NetricsRecOpSrc rec_ops)
 Perform a mixed set of record updates.
 
NetricsTableStats doRecOps (String table_name, bool do_max_work, params NetricsRecOp[] rec_ops)
 Perform a mixed set of record updates.
 
NetricsCmdStats[] cmdstats (String[] cmd_names)
 Retrieve processing statistics for commands.
 
NetricsCmdStats[] cmdstats (String[] cmd_names, double duration)
 Retrieve processing statistics for specified duration for commands.
 
NetricsCmdStats[] cmdstats (String[] cmd_names, double duration, double end_time)
 Retrieve processing statistics for specified time period.
 
void cmdstats_reset (String[] cmd_names, double start_time)
 Reset processing statistics for the specified commands.
 
void svrlogon ()
 Turn on search logging (must be enabled when the server starts up).
 
void svrlogoff ()
 Turn off search logging (must be enabled when the server starts up).
 
NetricsServerStats server_info ()
 Retrieve the server version information.
 
String svrversion ()
 Retreive the ibi™ Patterns - Search Server's version information.
 
bool isDecisionEngine ()
 
bool isGIPEnabled ()
 
bool isSortEnabled ()
 
bool isPsiEnabled ()
 
bool isDurableDataEnabled ()
 Return true if the server is using the durable-data feature.
 
String version ()
 Retreive the ibi™ Patterns - Search Server Interface version information.
 
ShutdownStatus svrshutdown ()
 Initiates a server shutdown.
 
ShutdownStatus svrshutdown (int timeout)
 Initiates a server shutdown.
 
void loadClusterConfiguration (String file_name)
 Load a new cluster configuration file on the gateway server.
 
void svrnoop ()
 
NetricsTranStats[] listTransactions (int idle_cutoff)
 Get statistics on open transactions.
 
void tranAbort (long tran_id)
 Abort a transaction.
 
void tranCommit (long tran_id)
 Commit a transaction.
 
void tranForceCommit (long tran_id)
 Commit a transaction even if it has errors.
 
void tranSetIdleOpts (int idle_time, String action)
 Set the idle transaction processing parameters on the server.
 
NetricsRecord[] recnext (NetricsTableCursor cursor)
 Retrieve records from a table cursor.
 
NetricsCompoundRecord[] compoundNext (NetricsTableCursor cursor)
 Retrieve compound records from a cursor.
 
int getMaxSocketUsage ()
 Return the maximum number of queries to perform on a given socket before closing it.
 
void setMaxSocketUsage (int val)
 Set the maximum number of queries to perform on a given socket before closing it.
 
TimeSpan? getMaxSocketLifetime ()
 Return the maximum lifetime of socket connections to the engine.
 
void setMaxSocketLifetime (TimeSpan? val)
 Set the maximum lifetime of socket connections to the engine.
 
int getConnectRetryCount ()
 Return the retry count for establishing a socket connection to the engine.
 
void setConnectRetryCount (int val)
 Set the retry count for establishing a socket connection to the engine.
 
int getConnectTimeout ()
 Return the per-attempt timeout for establishing a socket connection to the engine.
 
void setConnectTimeout (int val)
 Set the per-attempt timeout for establishing a socket connection to the engine.
 
CultureInfo setServerCultureInfo (CultureInfo culture_info)
 Sets the culture used by the interface when formatting and interpreting data exchanged with the server.
 
void setNetProtocols (ProtocolChoice protocols)
 Set the network protocols that will be used to connect to the ibi™ Patterns - Search Server.
 
long? getFormatTransmitDuration ()
 Gets the time spent formatting and transmitting the last command the current thread executed on this interface object.
 
long? getServerDuration ()
 Gets the time spent waiting for the server to begin responding to the last command the current thread executed on this interface object.
 
long? getReceiveParseDuration ()
 Gets the time spent receiving and parsing the response to the last command the current thread executed on this interface object.
 
long? getCommandDuration ()
 Gets the total time spent on the last command the current thread executed on this interface object.
 
bool getSSLEnabled ()
 Returns.
 
void setSSLEnabled (bool enable)
 Sets the SSL enable flag.
 
RemoteCertificateValidationCallback getCertificateValidator ()
 Get the current certificate-validation callback.
 
void setCertificateValidator (RemoteCertificateValidationCallback certValidator)
 Sets the certificate-validation callback.
 

Protected Member Functions

 NetricsServerInterface (String host, int port, bool debug, NetricsServerInterface.ConnectionPoolingPolicy pooling_policy)
 Create an object for interacting with an ibi™ Patterns - Search Server.
 

Detailed Description

Base class for all interactions with the ibi™ Patterns - Search Server.

All interactions with the ibi™ Patterns - Search Server are performed using objects of this class or the NetricsTransactions class, which is an extension of this class. All operations on the ibi™ Patterns - Search Server are exposed as methods of objects of this class.

The method calls used to perform operations on the ibi™ Patterns - Search Server do not retain any state, all information is maintained on the ibi™ Patterns - Search Server itself. Because these methods are stateless they are thread safe. However these objects do maintain certain connection information. Methods which update this information are NOT thread safe. These methods include: DebuggingOn, DebuggingOff, ParseDebuggingOn, ParseDebugginOff, setServerCultureInfo, setMaxSocketUsage, setMaxSocketLifetime, setMaxSocketIdleTime, setConnectRetryCount, setConnectTimeout, and setConnectionPoolingPolicy. None of these methods should ever be called on an object being shared by multiple threads.

This sample code shows how to specify a connection to the ibi™ Patterns - Search Server running on the localhost listening to port 5051 and obtain its version information.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
String host = "localhost";
int port = 5051;
NetricsServerStats version_info = si.server_info();
Console.WriteLine("Server Info: "+version_info.ToString());
}
}
Base class for all interactions with the ibi™ Patterns - Search Server.
Definition: NetricsServerInterface.cs:62
This class contains status information on the server process.
Definition: NetricsServerStats.cs:31
String server_info()
Return the server status string.
Definition: NetricsServerStats.cs:267
override string ToString()
Return report as a string.
Definition: NetricsServerStats.cs:202
ibi™ Patterns - Search .NET Interface Overview.
Definition: BaseObjectStats.cs:14

Member Enumeration Documentation

◆ ConnectionPoolingPolicy

Possible connection pooling policies.

Enumerator
None 

None : All connections made by this NetricsServerInterface object are transient.

Local 

Local: This NetricsServerInterface object has its own pool of connections.

Shared 

Shared: This NetricsServerInterface object uses a connection pool that is shared amongst similarly marked NetricsServerInterface objects within the application.

◆ ShutdownStatus

Shutdown the ibi™ Patterns - Search Server.

This sample code shows how to ping the ibi™ Patterns - Search Server.

using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
Console.Write("Server shutdown successful.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
A NetricsException is thrown whenever an error occurs.
Definition: NetricsException.cs:32
String getErrorDescription()
Get the description of the error.
Definition: NetricsException.cs:110
ShutdownStatus svrshutdown()
Initiates a server shutdown.
Definition: NetricsServerInterface.cs:3933
Exceptions
NetricsExceptionIf the server indicates that an error has occured
Enumerator
Initiated 

Shutdown has been started.

Complete 

Shutdown is done.

Constructor & Destructor Documentation

◆ NetricsServerInterface() [1/4]

NetricsServerInterface.NetricsServerInterface.NetricsServerInterface ( String  host,
int  port 
)
inline
Parameters
hostThe hostname of the machine on which the ibi™ Patterns - Search Server is running
portThe port number on which the ibi™ Patterns - Search Server is running

◆ NetricsServerInterface() [2/4]

NetricsServerInterface.NetricsServerInterface.NetricsServerInterface ( String  host,
int  port,
int  encodingNum 
)
inline
Parameters
hostThe hostname of the machine on which the ibi™ Patterns - Search Server is running
portThe port number on which the ibi™ Patterns - Search Server is running
encodingNumThe encoding number to use for the relevant character set.

◆ NetricsServerInterface() [3/4]

NetricsServerInterface.NetricsServerInterface.NetricsServerInterface ( String  host,
int  port,
bool  debug,
NetricsServerInterface::ConnectionPoolingPolicy  pooling_policy 
)
inlineprotected

Create an object for interacting with an ibi™ Patterns - Search Server.

Parameters
hostThe hostname or IP address of the machine on which the ibi™ Patterns - Search Server is running.
portThe port number which the ibi™ Patterns - Search Server is listening on
debugIf true output detailed information on all interactions with the server.
pooling_policyThe connection pooling policy to use.

◆ NetricsServerInterface() [4/4]

NetricsServerInterface.NetricsServerInterface.NetricsServerInterface ( String  host,
int  port,
bool  debug 
)
inline

Set debug to true to print socket output to stdout.

Parameters
hostThe hostname of the machine on which the ibi™ Patterns - Search Server is running
portThe port number on which the ibi™ Patterns - Search Server is running
debugPass true to turn on socket protocol debugging output.

Member Function Documentation

◆ addRecsFromFile()

NetricsTableStats NetricsServerInterface.NetricsServerInterface.addRecsFromFile ( String  tblName,
bool  replaceNotAdd,
NetricsRecFile  fileDef 
)
inline

Add or replace records from a file.

Parameters
tblNameDefines table records are added to or replaced in.
replaceNotAddIf true this replaces existing records, if false it adds new records.
fileDefDefines the name and format of the file Containing the records.
Returns
The statistics for the table after the add or replace operations were performed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - same as recadd)
See also
NetricsRecFile

This sample code shows how to add records from a file to an existing table starting with a key of 100.

The ibi™ Patterns - Search Server is running on the localhost listening to port 5051.

See NetricsRecFile for a definition of it's associated parameters.

using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
NetricsRecFile netricsRecFile = null;
String table = "names";
String encoding = "latin1";
String file = "c:\\temp\\names.csv";
bool doMaxWork = true;
bool leadingKey = false;
int initialKey = 20000;
bool fieldNamesFirst = false;
bool replaceNotAdd = false;
netricsRecFile = new NetricsRecFile(file, encoding, doMaxWork, leadingKey, initialKey, fieldNamesFirst, false, -1, null);
NetricsTableStats xresponse = si.addRecsFromFile(table, replaceNotAdd, null, netricsRecFile);
Console.Write(xresponse.getName() + ": " + xresponse.getNumRecs().ToString() + " records in table.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
Define name and format of a server side record source file.
Definition: NetricsRecFile.cs:112
NetricsTableStats addRecsFromFile(String tblName, bool replaceNotAdd, NetricsRecFile fileDef)
Add or replace records from a file.
Definition: NetricsServerInterface.cs:586
This class contains statistics on a table in the ibi™ Patterns - Search server.
Definition: NetricsTableStats.cs:22
String getName()
Definition: NetricsTableStats.cs:33
int getNumRecs()
Definition: NetricsTableStats.cs:98

◆ checkpoint()

String[] NetricsServerInterface.NetricsServerInterface.checkpoint ( String[]  tblnames)
inline

Checkpoint tables currently loaded in ibi Patterns - Search Engine. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].

Checkpointing a table allows the table to be restored to the state it was in at the time of the checkpoint. A checkpoint is made to a permanent file store, so checkpoints can be restored across different server invocations. A checkpoint restore is the fastest way to load a table.

In order to checkpoint a file the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

If one or more of the named tables do not exists a NetricsException is thrown with an error code of DBNOTFOUND. All tables that were found are checkpointed.

If some, but not all, of the tables fail to checkpoint for any other reason a NetricsException is thrown with error code PARTIALCHPT. Again some tables may have checkpointed successfully in this case.

If all tables fail to checkpoint correctly and not all of them failed because the named table didn't exist a NetricsException is thrown with error code CHPTFAILED. The extended error item will be a generic list containing the DBDESCRIPTOR for each table that failed to checkpoint correctly for any reason.

This sample code shows how to checkpoint the "names" table on the ibi™ Patterns - Search Server running on the localhost listening to port 5051.

using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
String[] tableList = { "names" };
si.checkpoint(tableList);
Console.Write("Table checkpointed.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String[] checkpoint(String[] tblnames)
Checkpoint tables currently loaded in ibi Patterns - Search Engine. Obsolete. Checkpoint/Restore is d...
Definition: NetricsServerInterface.cs:3057
Parameters
tblnamesThe names of the tables to be checkpointed. Pass null to checkpoint all tables currently in the server.
Returns
An array of the names of the tables that were successfully checkpointed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, DBNOTFOUND, PARTIALCHPT, CHPTFAILED, INTERNAL, NOSYSINIT)

◆ checkpointObjects()

NetricsObjectNameCollection NetricsServerInterface.NetricsServerInterface.checkpointObjects ( NetricsObjectNameCollection  objects)
inline

Checkpoint objects (tables, thesauri, character maps, rlink models) currently loaded in the ibi™ Patterns - Search Server. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].

Checkpointing an object allows it to be restored to the state it was in at the time of the checkpoint. A checkpoint is made to a permanent file store, so checkpoints can be restored across different server invocations. A checkpoint restore is the fastest way to load an object.

In order to checkpoint an object the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

If one or more of the named objects does not exist a NetricsException is thrown with an error code of DBNOTFOUND. All objects that were found are checkpointed.

If some, but not all, of the objects fail to checkpoint for any other reason a NetricsException is thrown with error code PARTIALCHPT. Again some objects may have checkpointed successfully in this case.

If all objects fail to checkpoint correctly and not all of them failed because the named table didn't exist a NetricsException is thrown with error code CHPTFAILED.

The extended error item will be a generic list containing the descriptor for each object that failed to checkpoint correctly for any reason.

If tables and/or thesauri with user-defined character maps are specified, those user-defined character maps are automatically added to the set of objects to checkpoint.

Parameters
objectsThe names of the objects to be checkpointed. Pass null to checkpoint all objects currently in the server.
Returns
An NetricsObjectNameCollection containing the names of the objects that were successfully checkpointed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, DBNOTFOUND, PARTIALCHPT, CHPTFAILED, INTERNAL, NOSYSINIT)
System.IO.IOExceptionIf an I/O error occurs.

◆ cmap_stats()

NetricsCharmapStats[] NetricsServerInterface.NetricsServerInterface.cmap_stats ( String[]  cmap_names)
inline

Lists statistics on character maps currently loaded on the server.

Parameters
cmap_namesA list of the character map names who's statistics should be returned. Set this to null to get statistics on all character maps.
Returns
An array of NetricsCharmapStats objects, one per character map loaded in the ibi™ Patterns - Search server.
See also
NetricsCharmapStats

◆ cmapcreate()

void NetricsServerInterface.NetricsServerInterface.cmapcreate ( NetricsCharmap  cmap)
inline

Create a character map in the ibi™ Patterns - Search Server.

Parameters
cmapThe NetricsCharmap object to create on the ibi™ Patterns - Search Server.

◆ cmapget()

NetricsCharmap NetricsServerInterface.NetricsServerInterface.cmapget ( String  name)
inline

Gets the content of a character-map.

Parameters
nameName of the character-map whose content is retrieved.
Returns
An object contenting the character-map content.

◆ cmaplist()

String[] NetricsServerInterface.NetricsServerInterface.cmaplist ( )
inline

Lists the character maps currently loaded in the ibi™ Patterns - Search Server.

Returns
An array of Strings, one per character map loaded in the ibi™ Patterns - Search Server

◆ cmdstats() [1/3]

NetricsCmdStats[] NetricsServerInterface.NetricsServerInterface.cmdstats ( String[]  cmd_names)
inline

Retrieve processing statistics for commands.

This reports statistics for the named commands. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands. This command will generate a report that includes all commands completed from the time the server was started until the time the request was received.

Parameters
cmd_namesThe names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
Returns
An array of NetricsCmdStats objects, one per requested command.
See also
NetricsCmdStats

◆ cmdstats() [2/3]

NetricsCmdStats[] NetricsServerInterface.NetricsServerInterface.cmdstats ( String[]  cmd_names,
double  duration 
)
inline

Retrieve processing statistics for specified duration for commands.

This reports statistics for the named commands starting from the present moment going duration seconds into the past. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

The duration value is approximate. Each time a report request is made that does not request a specific end_time a reporting tic-mark is made at that time. The start and end time for a report will be reset to the closest time tic-mark set by a previous report. (This implies the first report always includes the entire time span since the start of the server.) The normal procedure is to equest reports at a fixed interval requesting durations in units of the request interval. E.g. request a report every 5 minutes covering a 15 minute period.

Parameters
cmd_namesThe names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
durationThe time period in seconds to be covered by this report.
Returns
An array of NetricsCmdStats objects, one per requested command.
See also
NetricsCmdStats

◆ cmdstats() [3/3]

NetricsCmdStats[] NetricsServerInterface.NetricsServerInterface.cmdstats ( String[]  cmd_names,
double  duration,
double  end_time 
)
inline

Retrieve processing statistics for specified time period.

This reports statistics for the named commands ending at the given time going duration seconds into the past from that time. A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

The end time and duration are approximate. Each time a report request is made that does not request a specific end time a reporting tic-mark is made at that time. The start and end time for a report will be reset to the closest time tic-mark set by a previous report. (This implies the first report always includes the entire time span since the start of the server.) The normal procedure is to request reports at a fixed interval requesting durations in units of the request interval. E.g. request a report every 5 minutes covering a 15 minute period.

The end_time value is given in milliseconds from an arbitrary epic point, thus the only valid way to get an end_time value is to use a value returned by a previous report. So if you are requesting reports every 5 minutes and you want reports that cover the previous 5, 10, 15 minutes and the entire server time span the normal procedure would be something like:

String[] cmd_list = new { NetricsCmdStats.CMD_ALL };
NetricsCmdStats[] report_5 ;
NetricsCmdStats[] report_10 ;
NetricsCmdStats[] report_15 ;
NetricsCmdStats[] report_forever ;
report_5 = si.cmdstats(cmd_list,60.0*5.0);
double end_time = report_5[0].end_time();
report_10 = si.cmdstats(cmd_list,60.0*10.0,end_time);
report_15 = si.cmdstats(cmd_list,60.0*15.0,end_time);
report_forever = si.cmdstats(cmd_list,-1.0,end_time);
This class contains summary statistics from the server on usage of a particular command.
Definition: NetricsCmdStats.cs:57
double end_time()
Return the end time of this report.
Definition: NetricsCmdStats.cs:312
Parameters
cmd_namesThe names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
durationThe time period in seconds to be covered by this report. -1.0 can be used to indicate "forever".
end_timeThe ending time for a report.
Returns
An array of NetricsCmdStats objects, one per requested command.
See also
NetricsCmdStats

◆ cmdstats_reset()

void NetricsServerInterface.NetricsServerInterface.cmdstats_reset ( String[]  cmd_names,
double  start_time 
)
inline

Reset processing statistics for the specified commands.

This resets the processing statistics, removing any collected statistics for commands completed before start_time (the present moment if < 0.0). A command name of NetricsCmdStats.CMD_ALL can be used to retrieve statistics for all commands.

The start_time value is given in milliseconds from an arbitrary epic point, thus the only valid way to get a start_time value is to use a value returned by a previous report. As with end_time the start time is approximate and matches the start time of previously tic-marked reports.

Parameters
cmd_namesThe names of the commands to be included in the report. The class NetricsCmdStats has defines of all command names.
start_timeData for commands before this point is deleted.

◆ compoundNext()

NetricsCompoundRecord[] NetricsServerInterface.NetricsServerInterface.compoundNext ( NetricsTableCursor  cursor)
inline

Retrieve compound records from a cursor.

This method is used to retrieve compound records from a table cursor. A compound record consists of a parent record and all child records linked to that parent record. The cursor scans the parent table, and fetches all child records of the parent records returned to produce the compound records returned.

Parameters
cursorThe cursor being used to scan the table.
Returns
An array of NetricsCompoundRecords, the next batch from the cursor. The cursor position is updated.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND)
System.IO.IOExceptionIf an I/O error occurs
ArgumentExceptionif parent_table is not a parent table, of if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list.
See also
NetricsCompoundRecord, NetricsTableCursor

◆ cthcreate()

void NetricsServerInterface.NetricsServerInterface.cthcreate ( NetricsCombinedThesaurus  cthes)
inline

Create a combined thesaurus in the ibi™ Patterns - Search Server.

A Thesaurus is used for word substitution such as synonyms or related terms.

A Weighted Dictionary is a variant of a Thesaurus which can reduce the contribution of a synonym in the overall score.

A Combined Thesaurus combines the features of a Thesaurus and a Weighted Dictionary and can apply a penalty score to be applied to each Thesaurus class.

This sample code shows how to create a Combined Thesaurus in the ibi™ Patterns - Search Server running on the localhost listening to port 5051.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Combined Thesaurus input csv file
String file = "c:\\temp\\cthnames.csv";
//Combined Thesaurus name
String thesaurus = "myThesaurus";
// Use default encoding which is LATIN1 specified by the null
NetricsCombinedThesaurus wd = new NetricsCombinedThesaurus(thesaurus, file, null);
si.cthcreate(wd);
Console.Write("Combined thesaurus created.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
This class is used to define an ibi™ Patterns - Search Combined Thesaurus.
Definition: NetricsCombinedThesaurus.cs:28
Parameters
cthesThe NetricsCombinedThesaurus object to create on the ibi™ Patterns - Search Server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)

◆ DebuggingOff()

bool NetricsServerInterface.NetricsServerInterface.DebuggingOff ( )
inline

Turn off socket protocol debugging output.

Turn off socket protocol debugging output. This should only be used on the advice of ibi Patterns support.

Returns
the previous debugging state.

This sample shows how to turn off debugging on the client side.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
Console.Write("Client debugging turned off.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
bool DebuggingOff()
Turn off socket protocol debugging output.
Definition: NetricsServerInterface.cs:227

◆ DebuggingOn()

bool NetricsServerInterface.NetricsServerInterface.DebuggingOn ( )
inline

Turn on socket protocol debugging output.

Turn on very verbose socket protocol debugging output. This should only be used on the advice of ibi Patterns support.

Returns
the previous debugging state.

This sample shows how to turn on debugging on the client side.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
Console.Write("Client debugging turned on. Warning: This will generate verbose output and impact performance.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
bool DebuggingOn()
Turn on socket protocol debugging output.
Definition: NetricsServerInterface.cs:192

◆ delChildRecord()

NetricsTableStats NetricsServerInterface.NetricsServerInterface.delChildRecord ( String  table_name,
String  parent_key,
String  child_key,
bool  doMaxWork 
)
inline
See also
delChildRecords(string,string[],string[],bool)

◆ delChildRecords() [1/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.delChildRecords ( String  table_name,
ChildType  child_type,
String[]  parent_keys,
String[]  child_keys,
bool  doMaxWork 
)
inline

Delete multiple records from a child table.

This method adds the ability to select child record for deletion by orphan status. Only records with the given orphan status are deleted.

Parameters
table_nameThe name of the child table from which the records will be deleted
child_typeThe type of child records to delete. One of ORPHANS, NONORPHANS or ALL.
parent_keysThe parent record keys of the records to delete
child_keysThe child record keys of the records to delete. If null is passed in then all child records with the given parent record keys are deleted.
doMaxWorkContinue on error - deletes those records which do exist
Returns
The stats for the table after the records have been deleted.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
System.IO.IOExceptionIf an I/O error occurs
See also
NetricsTableStats

◆ delChildRecords() [2/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.delChildRecords ( String  table_name,
String[]  parent_keys,
String[]  child_keys,
bool  doMaxWork 
)
inline

Delete multiple records from a child table.

Parameters
table_nameThe name of the child table from which the records will be deleted
parent_keysThe parent record keys of the records to delete
child_keysThe child record keys of the records to delete
doMaxWorkContinue on error - deletes those records which do exist
Returns
The stats for the table after the records have been deleted.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
System.IO.IOExceptionIf an I/O error occurs
See also
NetricsTableStats

◆ delCompoundRecords()

NetricsTableStats[] NetricsServerInterface.NetricsServerInterface.delCompoundRecords ( String  parent_table,
String[]  child_tables,
String[]  parent_keys,
bool  delete_orphans,
bool  doMaxWork 
)
inline

Deletes a set of records from a parent table, and deletes associated child records from child tables.

Parameters
parent_tableThe name of the parent table. The table must exist in the Patterns server and have a table type of parent.
Parameters
child_tablesA list of names of child tables. Only child records from these tables are deleted. All tables listed must be children of parent_table. Duplicate names are not allowed. If null, all child tables of the given parent table are included.
Parameters
parent_keysKeys of parent records to be deleted.
Parameters
delete_orphansIf true, all child records whose parent-reference matches one of the keys in
parent_keys
will be deleted, regardless of orphan status.
If false, only non-orphan child records whose parent-reference matches one of the keys in
parent_keys
will be deleted.
Parameters
doMaxWorkIgnore record-not-found errors when deleting from the parent table.
Returns
A list of table statistics. The first item on the list is the statistics for the parent table after the delete is performed. The remaining items on the list are the statistics for the child tables after the deletes are performed, in the same order as given in child_tables. If child_tables was null the order is arbitrary.
Exceptions
NetricsExceptionIf the server indicates an error occured. Possible errors: TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN
Exceptions
System.IO.IOExceptionIf an I/O error occurs
Exceptions
ArgumentExceptionIf parent_table is not a parent table, or if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list, or if parent_keys is null, or if parent_table is null, or if a child table name is null.

NetricsCompoundRecord

◆ doRecOps() [1/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.doRecOps ( String  table_name,
bool  do_max_work,
NetricsRecOpSrc  rec_ops 
)
inline

Perform a mixed set of record updates.

This method performs a set of record update operations. The operations to perform are defined by a stream of NetricsRecOp objects. The operations are performed in the order they are returned from the NetricsRecOpSrc. Record operations performed earlier in the stream are seen by later operations in the stream. For example if a new record is added, a delete that follows it will delete the added record instead of failing. All operations are committed or rolled back as a unit.

Parameters
table_nameThe name of the ibi™ Patterns - Search table holding the records.
do_max_workIf true record key and record format errors are quietly ignored.
rec_opsThe source that provides the stream of record operations.
Returns
Statistics on the table state after the operation.

◆ doRecOps() [2/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.doRecOps ( String  table_name,
bool  do_max_work,
params NetricsRecOp[]  rec_ops 
)
inline

Perform a mixed set of record updates.

This method performs a set of record update operations. The operations to perform are defined by an array of NetricsRecOp objects. The operations are performed in the order they are given. Record operations performed earlier in the array are seen by later operations in the array. For example if a new record is added, a delete that follows it will delete the added record instead of failing. All operations are committed or rolled back as a unit.

Parameters
table_nameThe name of the ibi™ Patterns - Search table holding the records.
do_max_workIf true record key and record format errors are quietly ignored.
rec_opsAn array or list of record operations.

◆ getCertificateValidator()

RemoteCertificateValidationCallback NetricsServerInterface.NetricsServerInterface.getCertificateValidator ( )
inline

Get the current certificate-validation callback.

The validator is ignored if SSL is disabled.

Returns

the current certificate validator. The default is NetricsConMgr.DefaultCertificateValidator.

A null return indicates the application has changed validation back to the .NET Framework default.

◆ getChildRecords() [1/3]

NetricsRecord[] NetricsServerInterface.NetricsServerInterface.getChildRecords ( String  table_name,
ChildType  child_type,
String[]  parent_keys,
String[]  child_keys 
)
inline

Get multiple records from a child table.

This method should typically be used instead of performing multiple single record "gets" for performance reasons.

This method adds the ability to specify the type of child records to be returned: ORPHANS, NONORPHANS or ALL types.

Parameters
table_nameThe name of the child table to get the records from
child_typeThe type of child records to return. One of ORPHANS, NONORPHANS or ALL.
parent_keysThe parent record keys of the records to get
child_keysThe child record keys of the records to get
Returns
An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 0 or more records for each parent key is returned. There is a limit of parent_keys.Length+10000 on the number of records that are returned. If this limit is exceeded a a NetricsException with code ARRAYLEN is returned.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
System.IO.IOExceptionIf an I/O error occurs
See also
NetricsRecord

◆ getChildRecords() [2/3]

NetricsRecord[] NetricsServerInterface.NetricsServerInterface.getChildRecords ( String  table_name,
ChildType  child_type,
String[]  parent_keys,
String[]  child_keys,
bool  do_max_work 
)
inline

Get multiple records from a child table.

This method should typically be used instead of performing multiple single record "gets" for performance reasons.

This method adds the ability to specify the type of child records to be returned: ORPHANS, NONORPHANS or ALL types.

Parameters
table_nameThe name of the child table to get the records from
child_typeThe type of child records to return. One of ORPHANS, NONORPHANS or ALL.
parent_keysThe parent record keys of the records to get
child_keysThe child record keys of the records to get
do_max_workIf true record not found errors are ignored.
Returns
An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 0 or more records for each parent key is returned. There is a limit of parent_keys.Length+10000 on the number of records that are returned. If this limit is exceeded a a NetricsException with code ARRAYLEN is returned.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
System.IO.IOExceptionIf an I/O error occurs
See also
NetricsRecord

◆ getChildRecords() [3/3]

NetricsRecord[] NetricsServerInterface.NetricsServerInterface.getChildRecords ( String  table_name,
String[]  parent_keys,
String[]  child_keys 
)
inline

Get multiple records from a child table.

This method should typically be used instead of performing multiple single record "gets" for performance reasons.

Parameters
table_nameThe name of the child table to get the records from
parent_keysThe parent record keys of the records to get
child_keysThe child record keys of the records to get
Returns
An array of NetricsRecords. If child keys were provided one record for each key pair is returned. If only parent keys are provided (child_keys is null) then a set of 0 or more records for each parent key is returned. There is a limit of parent_keys.Length+10000 on the number of records that are returned. If this limit is exceeded a a NetricsException with code ARRAYLEN is returned.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
System.IO.IOExceptionIf an I/O error occurs
See also
NetricsRecord

◆ getCommandDuration()

long? NetricsServerInterface.NetricsServerInterface.getCommandDuration ( )
inline

Gets the total time spent on the last command the current thread executed on this interface object.

Returns
nanoseconds, or null if there was no such command.

◆ getCompoundRecords()

NetricsCompoundRecord[] NetricsServerInterface.NetricsServerInterface.getCompoundRecords ( String  parent_table,
String[]  child_tables,
params String[]  parent_keys 
)
inline

Get multiple compound records.

This method is used to retrieve compound records. A compound record consists of a parent record and all child records linked to that parent record. The records are fetched based on a list of the keys of the parent records. A list of the child tables to be included can be specified, by default all child tables of the parent table are included.

Parameters
parent_tableThe name of the parent table. The table listed must exist in the Patterns server and have a table type of parent.
child_tablesA list of the names of the child tables to be included in the compound record. All tables listed must be a child table of the given parent table. Duplicate names are not allowed. The order of listing is irrelevant. If this is null all child tables of the given parent table are included.
parent_keysThe parent record keys of the records to get
Returns
An array of NetricsCompoundRecords.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, ARRAYLEN)
System.IO.IOExceptionIf an I/O error occurs
ArgumentExceptionif parent_table is not a parent table, or if any child table is not a child of parent_table, or if a duplicate name exists in the child_tables list.
See also
NetricsCompoundRecord

◆ getConnectRetryCount()

int NetricsServerInterface.NetricsServerInterface.getConnectRetryCount ( )
inline

Return the retry count for establishing a socket connection to the engine.

Default is 1.

◆ getConnectTimeout()

int NetricsServerInterface.NetricsServerInterface.getConnectTimeout ( )
inline

Return the per-attempt timeout for establishing a socket connection to the engine.

Measured in milli-seconds. Default is 120000 (2 minutes).

◆ getFormatTransmitDuration()

long? NetricsServerInterface.NetricsServerInterface.getFormatTransmitDuration ( )
inline

Gets the time spent formatting and transmitting the last command the current thread executed on this interface object.

Returns
nanoseconds, or null if there was no such command.

◆ getMaxSocketLifetime()

TimeSpan? NetricsServerInterface.NetricsServerInterface.getMaxSocketLifetime ( )
inline

Return the maximum lifetime of socket connections to the engine.

Not relevent if connection pooling is turned off.

◆ getMaxSocketUsage()

int NetricsServerInterface.NetricsServerInterface.getMaxSocketUsage ( )
inline

Return the maximum number of queries to perform on a given socket before closing it.

Not relevent if connection pooling is turned off.

◆ getReceiveParseDuration()

long? NetricsServerInterface.NetricsServerInterface.getReceiveParseDuration ( )
inline

Gets the time spent receiving and parsing the response to the last command the current thread executed on this interface object.

Returns
nanoseconds, or null if there was no such command.

◆ getServerDuration()

long? NetricsServerInterface.NetricsServerInterface.getServerDuration ( )
inline

Gets the time spent waiting for the server to begin responding to the last command the current thread executed on this interface object.

Returns
nanoseconds, or null if there was no such command.

◆ getSSLEnabled()

bool NetricsServerInterface.NetricsServerInterface.getSSLEnabled ( )
inline

Returns.

SSL is disabled by default.

Returns
the SSL enable flag.

◆ idxlist()

NetricsIdxStats[] NetricsServerInterface.NetricsServerInterface.idxlist ( String[]  tblnames)
inline

Lists statistics for partitioned indexes.

This command can be used to retrieve information on all of the partition indexes associated with one or more tables loaded into the ibi™ Patterns - Search Server server. Information can be retrieved for all tables or a list of specific tables. Information for all indexes associated with the indicated tables is returned as a list of NetricsIdxStats objects. It is an error if a named table doesn't exist. If a table has no indexes an empty stats object is returned for that table.

Parameters
tblnamesThe names of the tables for which to retrieve statistics. Pass null to recieve information for indexes of all tables.
Returns
An array of NetricsIdxStats objects.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
See also
NetricsIdxStats

◆ isDecisionEngine()

bool NetricsServerInterface.NetricsServerInterface.isDecisionEngine ( )
inline
<summary>
Return true if the server indicates it is a Learning Engine
</summary>

This returns true if the server indicates it supports Learning Models. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support the Learning Model.

Returns
true if the server supports Learning Models, false otherwise.
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ isDurableDataEnabled()

bool NetricsServerInterface.NetricsServerInterface.isDurableDataEnabled ( )
inline

Return true if the server is using the durable-data feature.

NetricsServerStats.durable_data

◆ isGIPEnabled()

bool NetricsServerInterface.NetricsServerInterface.isGIPEnabled ( )
inline
<summary>
Return true if the server indicates GIP is the default prefilter.
</summary>

This returns true if the server indicates tables creation uses the GIP prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support the GIP prefilter.

Returns
true if the server indicates GIP is the default prefilter.
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ isPsiEnabled()

bool NetricsServerInterface.NetricsServerInterface.isPsiEnabled ( )
inline
<summary>
Return true if the server indicates PSI is the default prefilter.
</summary>

This returns true if the server indicates tables creation uses the PSI prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before PSI was released.

Returns
true if the server indicates PSI is the default prefilter.
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ isSortEnabled()

bool NetricsServerInterface.NetricsServerInterface.isSortEnabled ( )
inline
<summary>
Return true if the server indicates SORT is the default prefilter.
</summary>

Return true if the server indicates SORT is the default prefilter.
This returns true if the server indicates tables creation uses the SORT prefilter by default. Note that older versions of the server do not send back this information, so this method will return false for servers before release 4.3.1 even if they do support the SORT prefilter.

Returns
true if the server indicates SORT is the default prefilter.
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ list() [1/2]

NetricsTableStats[] NetricsServerInterface.NetricsServerInterface.list ( String[]  tblnames)
inline

Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.

Parameters
tblnamesThe names of the tables for which to receive statistics. Pass null to recieve a NetricsTableStats object for every table currently loaded
Returns
An array of NetricsTableStats objects, one per requested table
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
See also
NetricsTableStats

◆ list() [2/2]

NetricsTableStats[] NetricsServerInterface.NetricsServerInterface.list ( String[]  tblnames,
bool  includeVarAttrNames 
)
inline

Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.

Parameters
tblnamesThe names of the tables for which to receive statistics. Pass null to recieve a NetricsTableStats object for every table currently loaded
includeVarAttrNamesIf true, the returned statistics will include the names of all variable-attributes present in each table.There may be thousands of these.
Returns
An array of NetricsTableStats objects, one per requested table
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, FEATURESET, NOTBLDESC, NOSYSINIT)
See also
NetricsTableStats

◆ listTransactions()

NetricsTranStats[] NetricsServerInterface.NetricsServerInterface.listTransactions ( int  idle_cutoff)
inline

Get statistics on open transactions.

This method returns an array of NetricsTranStats objects, one object for each open transaction with an idle time greater than idle_cutoff. If idle_cutoff is less than 0 all open transactions are returned.

Idle time is measured from the completion of the last command associated with the transaction.

Parameters
idle_cutoffThe idle cutoff value in seconds. Only transactions that have been idle for this number of seconds or greater are returned. A value less than 0 will return all open transactions.
Exceptions
NetricsExceptionIf the server indicates that an error has occured.

◆ loadClusterConfiguration()

void NetricsServerInterface.NetricsServerInterface.loadClusterConfiguration ( String  file_name)
inline

Load a new cluster configuration file on the gateway server.

Parameters
file_nameThe name of the new file. This file and path must be recognizable within the context of the cluster gateway.

◆ ParseDebuggingOff()

bool NetricsServerInterface.NetricsServerInterface.ParseDebuggingOff ( )
inline

Turn off response parsing debugging output.

Turn off response parsing debugging output. This should only be used on the advice of ibi Patterns support.

Returns
the previous debugging state.

◆ ParseDebuggingOn()

bool NetricsServerInterface.NetricsServerInterface.ParseDebuggingOn ( )
inline

Turn on response parsing debugging output.

Turn on very verbose response parsing debugging output. This should only be used on the advice of ibi Patterns support.

Returns
the previous debugging state.

◆ recadd() [1/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recadd ( String  tblName,
NetricsRecord  rec 
)
inline

Add a single record to a table.

Parameters
tblNameThe name of the table that the record will be added to
recThe record which will be added
Returns
The stats for the table after the record has been added
Exceptions
NetricsExceptionIf the server indicates an error occured
See also
NetricsTableStats, NetricsServerInterface.recadd(String, NetricsTableRecSrc, bool, int)

◆ recadd() [2/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recadd ( String  tblName,
NetricsTableRecSrc  src,
bool  doMaxWork 
)
inline

recadd with no lock key or estimated number of record.

See also
NetricsServerInterface.recadd(String, NetricsTableRecSrc, bool, int)

Sample code

◆ recadd() [3/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recadd ( String  tblName,
NetricsTableRecSrc  src,
bool  doMaxWork,
int  estNumRecs 
)
inline

Add records to a table.

Parameters
tblNameThe name of the table that the records will be added to
srcThe record source for those records which will be added
doMaxWorkContinue on error - adds those records which do not already exist
estNumRecsThe estimated number of records in the record source.This is used by the server to determine the most efficient loading method. It need not be exact.
Returns
The stats for the table after the records have been added
Exceptions
NetricsExceptionIf the server indicates an error occured (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECEXISTS, UPDPARAM, SHUTDOWN)
See also
NetricsTableStats

This sample shows how to add records to a table from a csv input file.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// CSV input file of records to be added
String file = "c:\\temp\\names.csv";
// Target <i>ibi Patterns - Search</i> table
String table = "names";
// Estimated number of records to be added or -1 if not known
int estNumRecs = -1;
NetricsTableStats response = null;
// Set doMaxWork to true if you want to ignore format errors on input file and continue
bool doMaxWork=false;
// Set the NetricsRecFile to recadd without key from file.
NetricsRecFile netricsRecFile = new NetricsRecFile(file);
// Set the initalKey for the records being added to 20000
netricsRecFile.setInitialKey(20000);
// set the record source for the recadd method
NetricsCSVRecSrc src = new NetricsCSVRecSrc(netricsRecFile);
// Do the recadd
response = si.recadd(table, src, doMaxWork, estNumRecs);
Console.WriteLine("Records added: Number of records in table "+table+ " is "+ response.getNumRecs()+".");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
NetricsTableRecSrc implementation for CSV file records.
Definition: NetricsCSVRecSrc.cs:26
void setInitialKey(int initialKey)
Set the initial key flag to the given value.
Definition: NetricsRecFile.cs:512

◆ recdelete() [1/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recdelete ( String  tblName,
String  recKey 
)
inline

Delete a single record from a table.

Parameters
tblNameThe name of the table from which the record will be deleted
recKeyThe record key of the record to be deleted
Returns
The stats for the table after the record has been deleted
Exceptions
NetricsExceptionIf the server indicates that an error has occured
See also
NetricsTableStats, NetricsServerInterface.recdelete(String, String[], bool)

Sample code

◆ recdelete() [2/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recdelete ( String  tblName,
String[]  recKeys,
bool  doMaxWork 
)
inline

Delete records from a table.

Parameters
tblNameThe name of the table from which the records will be deleted.
recKeysThe record keys of the records to be deleted
doMaxWorkContinue on error - deletes those records which do exist, ignores those that don't.
Returns
The stats for the table after the records have been deleted
Exceptions
NetricsExceptionIf the server indicates an error occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM, SHUTDOWN)
See also
NetricsTableStats

This sample shows how to delete records from an ibi™ Patterns - Search table.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Target <i>ibi Patterns - Search</i> table
String table = "names";
// Do not continue on format errors
bool doMaxWork = false;
// Record keys of records to be deleted
String[] recKeys = {"1","2"};
NetricsTableStats response = si.recdelete(table, recKeys, doMaxWork);
Console.WriteLine("Records deleted: Number of records in table " + table + " is " + response.getNumRecs() + ".");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}

◆ recget() [1/2]

NetricsRecord NetricsServerInterface.NetricsServerInterface.recget ( String  tblName,
String  recKey 
)
inline

Get a single record from a table.

Parameters
tblNameThe name of the table to get the record from
recKeyThe record key of the record
Exceptions
NetricsExceptionIf the server indicates that an error has occured
See also
NetricsTableStats, NetricsServerInterface.recget(String, String[])

Sample code

◆ recget() [2/2]

NetricsRecord[] NetricsServerInterface.NetricsServerInterface.recget ( String  tblName,
String[]  recKeys 
)
inline

Get multiple records from a table.

This method should typically be used instead of performing multiple single record "gets" for performance reasons.

Parameters
tblNameThe name of the table to get the records from
recKeysThe record keys of the records to get
Returns
An array of NetricsRecords, one per record requested
Exceptions
NetricsExceptionIf the server indicates an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECKEY, NOTBLDESC, NORECKEY, RECNOTFOUND, UPDPARAM)
See also
NetricsRecord, NetricsServerInterface.recget(String, String[])

Sample code

This sample shows how to get/read records from an ibi™ Patterns - Search table.

class MyClass {
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Target <i>ibi Patterns - Search</i> table
String table = "names";
// Record keys of records to be gotten
String[] recKeys = { "1", "2" };
NetricsRecord[] response = si.recget(table, recKeys);
// keyField of record returned from recget
String keyField = null;
// data fields returned from recget
String[] data = null;
// Write the data out to the console
for (int i = 0; i < response.Length; i++)
{
keyField = response[i].getKey();
data = response[i].getFields();
Console.Write("key=" + keyField + " : Data=" + String.Join(",", data) + "\n");
}
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String getKey()
Get the key of a record.
Definition: NetricsBaseRecord.cs:245
String[] getFields()
Can be used to get the content of a record.
Definition: NetricsBaseRecord.cs:349
This class holds record data for an ibi™ Patterns - Search table.
Definition: NetricsRecord.cs:26

◆ recnext()

NetricsRecord[] NetricsServerInterface.NetricsServerInterface.recnext ( NetricsTableCursor  cursor)
inline

Retrieve records from a table cursor.

This fetches the next batch of records from a table cursor, updating the cursor position.

Parameters
cursorthe cursor we are fetching from.
Returns
An array of records representing the next batch of records from the cursor. If the cursor is at EOT null is returned. The number of records returned could be less than cursor.getBatchSize() if this is the last batch.

◆ recreplace() [1/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recreplace ( String  tblName,
NetricsRecord  rec 
)
inline

Replace a single existing record in a table.

Parameters
tblNameThe name of the table containing the record being replaced
recThe new record. The value of its record key should be the record key of the record being replaced
Returns
The stats for the table after the record has been replaced
Exceptions
NetricsExceptionIf the server indicates that an error has occured
See also
NetricsTableStats, NetricsServerInterface.recreplace(String, NetricsTableRecSrc, bool)

Sample code

◆ recreplace() [2/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recreplace ( String  tblName,
NetricsTableRecSrc  src,
bool  doMaxWork 
)
inline

Replace records in a table.

Parameters
tblNameThe name of the table in which records will be replaced.
srcThe record source for those records which will be replaced
doMaxWorkContinue on error - replaces those records which do exist
Returns
The stats for the table after the records have been replaced


Exceptions
NetricsExceptionIf the server indicates an error occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECNOTFOUND, UPDPARAM, SHUTDOWN)
See also
NetricsTableStats

This sample shows how to replace records in a table from a csv input file.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// CSV input file of records to be replaced
String file = "c:\\temp\\names.csv";
// Target <i>ibi Patterns - Search</i> table
String table = "names";
NetricsTableStats response = null;
// Set doMaxWork to true if you want to ignore format errors on input file and continue
bool doMaxWork = false;
// Load .csv file.
// CSV is without a key in file.
NetricsRecFile netricsRecFile = new NetricsRecFile(file);
// Set the initalKey for the records being replaced. Key is incremented by 1 for each record in file.
netricsRecFile.setInitialKey(1);
// First record in csv file is a data record and not a header so setFieldNamesFirst
// should be set to false
netricsRecFile.setFieldNamesFirst(false);
// set the record source for the recadd method
NetricsCSVRecSrc src = new NetricsCSVRecSrc(netricsRecFile);
response = si.recreplace(table, src, doMaxWork);
Console.WriteLine("Records replace: Number of records in table " + table + " is " + response.getNumRecs() + ".");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
void setFieldNamesFirst(bool fieldNamesFirst)
Set the field names first flag.
Definition: NetricsRecFile.cs:622

◆ recupdate() [1/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recupdate ( String  tblName,
NetricsRecord  rec 
)
inline

Update a single existing record in a table.

Add the record if it doesn't exist, replace it if it does.

Parameters
tblNameThe name of the table containing the record to be updated.
recThe new record.
Returns
The stats for the table after the operation is completed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured
See also
NetricsTableStats

◆ recupdate() [2/2]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.recupdate ( String  tblName,
NetricsTableRecSrc  src,
bool  doMaxWork 
)
inline

Update records in a table.

This will add each of the records from the source to the named table if the do not already exist, or update them if they do exist.

Parameters
tblNameThe name of the table to be updated.
srcProvides the records to be updated.
doMaxWorkContinue on error - ignore records with errors and continue processing.
Returns
The stats for the table after the operation is completed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, DUPRECKEYS, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, RECNOTFOUND, UPDPARAM, SHUTDOWN)
See also
NetricsTableStats

◆ restore()

String[] NetricsServerInterface.NetricsServerInterface.restore ( String[]  tblnames)
inline

Restore tables previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].

This restores a table to the state of the latest checkpoint for that table. The checkpoint could have been made from this invocation of the server, in which case this backs up the state of the table to that at the time of the last checkpoint, or in a previous invocation of the server, in which case this is a way to quickly reload a table.

In order to restore a file the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

If some, but not all, of the tables fail to restore a NetricsException is thrown with error code PARTIALRESTORE.

If all tables fail to restore correctly a NetricsException is thrown with error code RESTOREFAILED.

This sample code shows how to restore the "names" table from a previous checkpoint.

using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
String[] tableList = { "names" };
si.restore(tableList);
Console.Write("Table restored.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String[] restore(String[] tblnames)
Restore tables previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durabl...
Definition: NetricsServerInterface.cs:3216
Parameters
tblnamesThe names of the tables to be restored. Pass null to restore all tables that were previously checkpointed.
Returns
An array of the names of the tables that were successfully restored.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, PARTIALRESTORE, RESTOREFAILED, INTERNAL, NOSYSINIT, SHUTDOWN)

◆ restoreObjects()

NetricsObjectNameCollection NetricsServerInterface.NetricsServerInterface.restoreObjects ( NetricsObjectNameCollection  objects)
inline

Restore objects previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].

This restores objects to the state of the latest checkpoint for those objects. The checkpoint could have been made from this invocation of the server, in which case this backs up the state of the objects to that at the time of the last checkpoint, or in a previous invocation of the server, in which case this is a way to quickly reload objects.

When user-defined character-maps are in use, it is strongly recommended that objects include all character maps.

In order to restore objects the server must have been started with checkpointing enabled. See the server user's manual for information on how to enable checkpointing.

If some, but not all, of the objects fail to restore a NetricsException is thrown with error code PARTIALRESTORE.

If all objects fail to restore correctly a NetricsException is thrown with error code RESTOREFAILED.

Parameters
objectsThe names of the objects to be restored. Pass null to restore all objects that were previously

checkpointed.

Returns
An NetricsObjectNameCollection containing the names of the objects that were successfully restored.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - DBPARAM, NODBDESC, EXPECTDBDESC, DUPDBDESCS, FEATURESET, PARTIALRESTORE, RESTOREFAILED, INTERNAL, NOSYSINIT, SHUTDOWN)
System.IO.IOExceptionIf an I/O error occurs.

◆ rlcreate()

void NetricsServerInterface.NetricsServerInterface.rlcreate ( String  rlModelName,
String  rlModelFile 
)
inline

Create a learning engine model in the server.

Parameters
rlModelNameThe name of the model to create.
rlModelFileThe location of the model on the server's file-system. It must be located inside the server's loadable-data directory.

◆ rlcreate_l() [1/2]

void NetricsServerInterface.NetricsServerInterface.rlcreate_l ( String  rlModelName,
String  rlModelFile 
)
inline

Like rlcreate_l(rlModelName, rlModelFile, bool), except the gateway model-in-memory flag is left at the server default (currently false).

See rlcreate_l(String,String,bool).

◆ rlcreate_l() [2/2]

void NetricsServerInterface.NetricsServerInterface.rlcreate_l ( String  rlModelName,
String  rlModelFile,
bool  allowLargeGatewayMem 
)
inline

Create a learning engine model in the server.

Parameters
rlModelNameThe name of the model to create.
rlModelFileThe location of the model on disk.
allowLargeGatewayMemIf loading into a cluster, enabling this flag allows the gateway to temporarily store the model in memory. If the flag is not enabled, the gateway will temporarily store the model in a file. In this case, if the gateway is not configured with a temporary storage directory, a FEATURESET error is returned. Enabling theis flag when loading extremely large models (> 50 MB) will return a PARAMVAL error. This flag is ignored when not loading to a cluster.

◆ rldelete()

void NetricsServerInterface.NetricsServerInterface.rldelete ( String[]  modellist)
inline

Delete one or more ibi™ Patterns - Search Learn Models.

This deletes or more ibi™ Patterns - Search Learn Models currently loaded on the ibi™ Patterns - Search Server.

If any of the model names given are not on the engine a NetricsException error is thrown with a code of RLINKMODELNOTFOUND, however all other models will still be deleted.

Parameters
modellistThe names of the models to be deleted. Pass null to delete all models on the server.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - NODBDESC, RLINKMODELNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)

◆ rleval()

double NetricsServerInterface.NetricsServerInterface.rleval ( String  rlModelName,
double[]  featurevec 
)
inline

Evaluate an ibi™ Patterns - Search Learn Model with the given vector of feature values.

Parameters
rlModelNameThe name of the model to use in the evaluation.
featurevecAn array of double feature values (from 0.0 to 1.0) which will be evaluated by the model. The number of features in this array must be the same as the model was created and trained with.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - NORLINKMODEL, RLINKMODELNOTFOUND, NOFEATUREVEC, NUMFEATURESMISMATCH, FEATURESET, IOERROR, PARAMVAL)

◆ rllist()

NetricsModelStats[] NetricsServerInterface.NetricsServerInterface.rllist ( String[]  modellist)
inline

List information on ibi™ Patterns - Search Learn Models.

This lists basic information on one or more ibi™ Patterns - Search Learn Models currently loaded on the ibi™ Patterns - Search Server.

If any of the model names given are not on the engine a NetricsException error is thrown with a code of RLINKMODELNOTFOUND.

Parameters
modellistThe names of the models to be listed. Pass null to list all models on the server.
Returns
An array of NetricsModelStats objects.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - NODBDESC, RLINKMODELNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)
See also
NetricsModelStats

◆ scoreRecords() [1/2]

NetricsSearchResponse NetricsServerInterface.NetricsServerInterface.scoreRecords ( NetricsQuery  query,
NetricsSearchOpts  query_opts,
NetricsTable  rec_format,
NetricsTableRecSrc  rec_src 
)
inline

Score all records from a record source against a query.

This scores all records retrieved from a record source, against a query, returning a scored search result for each record given.

All records are scored and returned, even if they receive a reject score because of errors or invalid or empty data.

Parameters
queryThe query to run against the records. The query is the same as for a standard search except no table settings are required (they may be given, but are ignored).
query_optsThese are the search options for the query. They are the same as for the standard search except those options relating to the prefilter are ignored.
rec_formatThis is a table definition. It provides the field names, field types and character maps for the fields in the records. A full table definition may be given, but all parts except field names, field types and character maps are ignored.
rec_srcA NetricsTableRecSrc object. All records from this object are sent to the server for scoring. The fields of all of the records must match the format defined in the rec_format argument.
Returns
A NetricsSearchResponse object containing the results of the search. The search response contains one NetricsSearchResult for each record given.
See also
NetricsQuery, NetricsSearchOpts, NetricsTable, NetricsTableRecSrc

◆ scoreRecords() [2/2]

NetricsSearchResponse NetricsServerInterface.NetricsServerInterface.scoreRecords ( NetricsQuery  query,
NetricsSearchOpts  query_opts,
NetricsTable  rec_format,
params NetricsRecord[]  records 
)
inline

Score one or more records against a query.

This scores a single record, or a list of records, against a query returning a scored search result for each record given.

All records are scored and returned, even if they receive a reject score because of errors or invalid or empty data.

Parameters
queryThe query to run against the records. The query is the same as for a standard search except no table settings are required (they may be given, but are ignored).
query_optsThese are the search options for the query. They are the same as for the standard search except those options relating to the prefilter are ignored.
rec_formatThis is a table definition. It provides the field names, field types and character maps for the fields in the records. A full table definition may be given, but all parts except field names, field types and character maps are ignored.
recordsOne or more records or an array of records. The fields of the records must match the format defined in the rec_format argument.
Returns
A NetricsSearchResponse object containing the results of the search. The search response contains one NetricsSearchResult for each record given.
See also
NetricsQuery, NetricsSearchOpts, NetricsTable

◆ search() [1/2]

NetricsSearchResponse NetricsServerInterface.NetricsServerInterface.search ( NetricsSearchCfg  cfg,
NetricsSearchOpts  opts 
)
inline

Version of search to search a single table.

This sample shows how to perform a search of an ibi™ Patterns - Search table.

// In this example a Simple search will be configured. The sample demonstrates searching
// the names table for the query string "brown dennis". The fields to matched against this
// string are "last" and "first". The weight for "last" is 1.0 and for "first" is .5. In this
// case the "last" name will have a higher importance in the score so that records with a "last"
// match will have a higher similarity score than those of "first" and will appear higher in the
// result set in the response.
class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Quuery will contain the query string or tokens to be matched against
String query = "brown dennis";
// Table is the <i>ibi Patterns - Search</i> table to be search/matched against query
String table = "names";
// FieldNames contain the fields within the table to be searhed/matched against.
// If fieldNames is set to null then all fields will be searched/matched against
String[] fieldNames = {"last" , "first"};
// FieldWeights is an array that must be the same length as fields and contain the
// weights (0.0 - 1.0) of each field that contribute to the overall score of the result
double[] fieldWeights = { 1.0, .5 };
// Create NetricsSearchOpts object using the defaults
// Create the NetricsSearchCfg pointing to the table to be searched/matched against
NetricsSearchCfg tblCfg = new NetricsSearchCfg(table);
// Add a Simple query to the NetricsSearchCfg using the query, fieldNames and fieldWeights
tblCfg.setNetricsQuery(NetricsQuery.Simple(query, fieldNames, fieldWeights));
// Perform the search/match using the NetricsSearchCfg and NetricsSearchOpts
NetricsSearchResponse resp = si.search(tblCfg, opts);
String s = "";
// Get the results of the search/match
// Create viables for result processing
String[] xfieldNames;
String[] xfields;
// Iterate through the result records
for (int i = 0; i < res.Length; i++)
{
// Get the fieldNames in the result record
xfieldNames = res[i].getFieldNames();
// Get the data for each fieldName in result record
xfields = res[i].getFields();
// Get the score for this result record
double score = res[i].getMatchScore();
// Build the printline for the result record
s = s + "Rank=" + i + ", Score=" + score.ToString();
for (int x = 0; x < xfields.Length; x++)
{
s = s + ", " + xfieldNames[x] + "=" + xfields[x];
}
s = s + "\n";
}
Console.WriteLine(s);
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
// The following is an example of a multi-query where different query strings can be used in a search across
// different fields within a table. This requires first configuring a Simple query for each query
// string along with the fields to be searched, and then either "And" or "Or" them together. In this
// example we will query the "names" table using a query string against the "last" field and a another query
// string against the "first" field. Each of these queries are referred to as a querylet. We will
// apply a higher weight to the "last" field querylet and apply a the "nicknames" thesaurus to the
// "first" field querylet treating the related terms within the thesaurus as equivalent.
using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Table is the <i>ibi Patterns - Search</i> table to be search/matched against query
String table = "names";
// Going to use 2 NetricsQuery for the search configuration
NetricsQuery[] nqs = new NetricsQuery[2];
// Create NetricsSearchOpts object using the defaults
// Create the NetricsSearchCfg pointing to the table to be searched/matched against
NetricsSearchCfg tblCfg = new NetricsSearchCfg(table);
// Query will contain the query string for the first querylet which is "last
String query = "brown";
// FieldNames contain the fields within the table to be searhed/matched against.
// If fieldNames is set to null then all fields will be searched/matched against
String[] fieldNames = { "last" };
// Create a Simple query for the "last" names search
nqs[0] = NetricsQuery.Simple(query, fieldNames, null);
// Set up the second Simple query
query = "den";
fieldNames[0] = "first";
nqs[1] = NetricsQuery.Simple(query, fieldNames, null);
// Use the nicknames thesaurus for this querylet associated with "first" field search
// and with the weight of 1.0 to treat related terms or synanyms the same.
// i.e. "Den" is equivalent to "Dennis"
nqs[1].useThesaurus("nicknames", 1.0);
// QueryletWeights is an array that must be the same length as the number of querylets
// and is the weight applied to each querylet in the search which impacts the similarity
// scrore. In this case there will be two querylets that will be ANDed together to create
// a single search configuration
double[] queryletWeights = { 1.0, .5 };
// Now AND the two Simple querys together to create the final NetricsQuery for the search
NetricsQuery nqAnded = NetricsQuery.And(queryletWeights, nqs);
// Set the NetricsSearchCfg;
tblCfg.setNetricsQuery(nqAnded);
// Perform the search/match using the NetricsSearchCfg and NetricsSearchOpts
NetricsSearchResponse resp = si.search(tblCfg, opts);
String s = "";
// Get the results of the search/match
// Create viables for result processing
String[] xfieldNames;
String[] xfields;
// Iterate through the result records
for (int i = 0; i < res.Length; i++)
{
// Get the fieldNames in the result record
xfieldNames = res[i].getFieldNames();
// Get the data for each fieldName in result record
xfields = res[i].getFields();
// Get the score for this result record
double score = res[i].getMatchScore();
// Build the printline for the result record
s = s + "Rank=" + i + ", Score=" + score.ToString();
for (int x = 0; x < xfields.Length; x++)
{
s = s + ", " + xfieldNames[x] + "=" + xfields[x];
}
s = s + "\n";
}
Console.WriteLine(s);
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
// This an example of using a Cognate Query. It uses the same string comparison algorithm but performs
// the match with multiple query strings. For instance, a first and last name can be searched against
// the first and last name fields of the database. This aids in finding transposted fields (where a first
// name occurs in the last name field or vice versa). The length of the qstrs array must always equal the
// length of the fldnames array. The fldweights array should also be that length if is used. The noncogwgt
// is the weight to assign transposed field matches (if noncogwgt is set to .8, a first name match in the
// last name field would contribute 80% to the final score). <br>
using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Quuery array will contain the query strings or tokens to be matched against
String[] queryStringArray = {"brown", "dennis"};
// Table is the <i>ibi Patterns - Search</i> table to be search/matched against query
String table = "names";
// FieldNames contain the fields within the table to be searhed/matched against.
// If fieldNames is set to null then all fields will be searched/matched against
String[] fieldNames = { "last", "first" };
// FieldWeights is an array that must be the same length as fields and contain the
// weights (0.0 - 1.0) of each field that contribute to the overall score of the result
double[] fieldWeights = { 1.0, .5 };
// Create NetricsSearchOpts object using the defaults
// Create the NetricsSearchCfg pointing to the table to be searched/matched against
NetricsSearchCfg tblCfg = new NetricsSearchCfg(table);
// Add a Cognate query to the NetricsSearchCfg using the query strings, fieldNames,
// fieldWeights and a cognateweight which is used to lower the score of miss fielded
// records. In this case "last"="brown" and "first"="dennis" is an exact match
// with a similarity score of 1, while "last"="dennis" and "first"="brown" will be a
// match with a similarity score of .8
// Use a cognate weight of .8
double cognateweight = .8;
tblCfg.setNetricsQuery(NetricsQuery.Cognate(queryStringArray, fieldNames, fieldWeights, cognateweight));
// Perform the search/match using the NetricsSearchCfg and NetricsSearchOpts
NetricsSearchResponse resp = si.search(tblCfg, opts);
String s = "";
// Get the results of the search/match
// Create viables for result processing
String[] xfieldNames;
String[] xfields;
// Iterate through the result records
for (int i = 0; i < res.Length; i++)
{
// Get the fieldNames in the result record
xfieldNames = res[i].getFieldNames();
// Get the data for each fieldName in result record
xfields = res[i].getFields();
// Get the score for this result record
double score = res[i].getMatchScore();
// Build the printline for the result record
s = s + "Rank=" + i + ", Score=" + score.ToString();
for (int x = 0; x < xfields.Length; x++)
{
s = s + ", " + xfieldNames[x] + "=" + xfields[x];
}
s = s + "\n";
}
Console.WriteLine(s);
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String[] getFieldNames()
Returns an array of Strings which are the names of the fields for the source table of the record.
Definition: NetricsMappedRecord.cs:120
NetricsQuery objects are used to implement the complex query structures introduced with release 4....
Definition: NetricsQuery.cs:66
void useThesaurus(String thesname, double theswgt)
Assign a thesaurus to be used by the NetricsQuery object. The thesaurus and the query fields should u...
Definition: NetricsQuery.cs:1835
static NetricsQuery Cognate(String[] qstrs, String[] fldnames, double[] fldweights, double noncogwgt)
Create a Cognate Query Expression Node.
Definition: NetricsQuery.cs:1638
static NetricsQuery Simple(String qstr, String[] fldnames, double[] fldweights)
Create a Simple Query Expression Node.
Definition: NetricsQuery.cs:397
static NetricsQuery And(double[] weights, NetricsQuery[] nqs)
Create an AND Query Expression Node.
Definition: NetricsQuery.cs:581
This class is used with the search methods of the NetricsServerInterface class to configure a query.
Definition: NetricsSearchCfg.cs:23
void setNetricsQuery(NetricsQuery nq)
Set the NetricsQuery to be performed.
Definition: NetricsSearchCfg.cs:170
This class is used to configure search options which apply for the overall search (for all tables bei...
Definition: NetricsSearchOpts.cs:17
This class represents the ibi™ Patterns - Search Server's response to a search command.
Definition: NetricsSearchResponse.cs:23
NetricsSearchResult[] getSearchResults()
Get the records returned by the search.
Definition: NetricsSearchResponse.cs:194
This class extends NetricsMappedRecord adding information relevant to a search result (match score,...
Definition: NetricsSearchResult.cs:24
double getMatchScore()
Get the overall match score for this record.
Definition: NetricsSearchResult.cs:236
NetricsSearchResponse search(NetricsSearchCfg cfg, NetricsSearchOpts opts)
Version of search to search a single table.
Definition: NetricsServerInterface.cs:1321
Parameters
cfgThe search configuration.
optsThe search options.
Returns

◆ search() [2/2]

NetricsSearchResponse NetricsServerInterface.NetricsServerInterface.search ( NetricsSearchCfg[]  tblCfgs,
NetricsSearchOpts  opts 
)
inline

Perform a search.

Queries are set in the NetricsSearchCfg objects and overall search options are set in the NetricsSearchOpts object

Parameters
tblCfgsOne NetricsSearchCfg per table which will be searched (can be specified in any order)
optsThe configuration object for the overall search - allows a number of options for searching
Returns
A NetricsSearchResponse object containing the results of the search
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, TBLNOTFOUND, EXPECTTBLDESC, EXPECTRTBLDESC, EXPECTLIST, EXPECTQUERY, FEATUREOFF, FEATURESET, LISTLEN, LOOKUP, NOTBLDESC, NOQUERY, NSFIELD, NUMFIELDS, PARAMCONFLICT, PARAMMISSING, PARAMVAL, PARTIAL, PREDTYPE, SRCHPARAM, THESNOTFOUND, UNKFIELD)
See also
NetricsSearchCfg, NetricsSearchOpts

◆ server_info()

NetricsServerStats NetricsServerInterface.NetricsServerInterface.server_info ( )
inline

Retrieve the server version information.

This returns the complete server version and status information.

Returns
a NetricsServerStats object.
See also
NetricsServerStats

◆ setCertificateValidator()

void NetricsServerInterface.NetricsServerInterface.setCertificateValidator ( RemoteCertificateValidationCallback  certValidator)
inline

Sets the certificate-validation callback.

Parameters
certValidatorThe callback used to filter certificate validation.

A custom certificate validator is needed only in unusual circumstances. For example if a self-signed certificate is in use.
See NetricsConMgr.NetricsConMgr.setCertificateValidator(RemoteCertificateValidationCallback) for sample usage.

◆ setConnectionPoolingPolicy()

void NetricsServerInterface.NetricsServerInterface.setConnectionPoolingPolicy ( ConnectionPoolingPolicy  policy)
inline

Changes the connection pooling policy for this NetricsServerInterface object.
Use of this function is not generally recommended.

Parameters
policyThe new pooling policy.

◆ setConnectRetryCount()

void NetricsServerInterface.NetricsServerInterface.setConnectRetryCount ( int  val)
inline

Set the retry count for establishing a socket connection to the engine.

Default is 1. Do not set this value unless you're experiencing platform-specific socket issues.

◆ setConnectTimeout()

void NetricsServerInterface.NetricsServerInterface.setConnectTimeout ( int  val)
inline

Set the per-attempt timeout for establishing a socket connection to the engine.

Measured in milli-seconds. Default is 120000 (2 minutes). Do not set this value unless you're experiencing platform-specific socket issues.

◆ setMaxSocketLifetime()

void NetricsServerInterface.NetricsServerInterface.setMaxSocketLifetime ( TimeSpan?  val)
inline

Set the maximum lifetime of socket connections to the engine.

Not relevent if connection pooling is turned off. Do not set this value unless you're experiencing platform-specific socket issues.

◆ setMaxSocketUsage()

void NetricsServerInterface.NetricsServerInterface.setMaxSocketUsage ( int  val)
inline

Set the maximum number of queries to perform on a given socket before closing it.

Not relevent if connection pooling is turned off. Do not set this value unless you're experiencing platform-specific socket issues.

◆ setNetProtocols()

void NetricsServerInterface.NetricsServerInterface.setNetProtocols ( ProtocolChoice  protocols)
inline

Set the network protocols that will be used to connect to the ibi™ Patterns - Search Server.

Parameters
protocolsWhich protocols to use.

*‍/

◆ setServerCultureInfo()

CultureInfo NetricsServerInterface.NetricsServerInterface.setServerCultureInfo ( CultureInfo  culture_info)
inline

Sets the culture used by the interface when formatting and interpreting data exchanged with the server.

Use this only if the server has been set to use a non-English culture. This should only be used on the advice of ibi Patterns support.

Parameters
culture_infoThe new server culture. Pass null to reset to the default.
Returns
the previous culture info.

◆ setSSLEnabled()

void NetricsServerInterface.NetricsServerInterface.setSSLEnabled ( bool  enable)
inline

Sets the SSL enable flag.

SSL is disabled by default.

Parameters
enablePass true to enable SSL, false to disable.

setCertificateValidator(RemoteCertificateValidationCallback)

◆ svrlogoff()

void NetricsServerInterface.NetricsServerInterface.svrlogoff ( )
inline

Turn off search logging (must be enabled when the server starts up).

Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - EXPECTRTBLDESC, IPCERR, IPCTIMEOUT, IPCEOF, HANDSHAKE)

◆ svrlogon()

void NetricsServerInterface.NetricsServerInterface.svrlogon ( )
inline

Turn on search logging (must be enabled when the server starts up).

Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - EXPECTRTBLDESC, IPCERR, IPCTIMEOUT, IPCEOF, HANDSHAKE)

◆ svrnoop()

void NetricsServerInterface.NetricsServerInterface.svrnoop ( )
inline
<summary> Perform a noop on the <i>ibi&trade; Patterns - Search</i> Server.</summary>

This method is the quickest way to determine if the ibi™ Patterns - Search server is responding or not.

This sample code shows how to ping the ibi™ Patterns - Search Server.

using System;
class MyClass
{
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
si.svrnoop();
Console.Write("Server No Operation (NOOP) successful.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
void svrnoop()
Definition: NetricsServerInterface.cs:4017
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ svrshutdown() [1/2]

ShutdownStatus NetricsServerInterface.NetricsServerInterface.svrshutdown ( )
inline

Initiates a server shutdown.

Returns
A status indicating the state of the server shutdown.

◆ svrshutdown() [2/2]

ShutdownStatus NetricsServerInterface.NetricsServerInterface.svrshutdown ( int  timeout)
inline

Initiates a server shutdown.

Parameters
timeoutTime in seconds to wait for the server to free up resources.
Returns
A status indicating the state of the server shutdown.

◆ svrversion()

String NetricsServerInterface.NetricsServerInterface.svrversion ( )
inline

Retreive the ibi™ Patterns - Search Server's version information.

This sample code shows how to specify a connection to the ibi™ Patterns - Search Server and obtain its version.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
String host = "localhost";
int port = 5051;
String version = si.svrversion();
}
}
String svrversion()
Retreive the ibi™ Patterns - Search Server's version information.
Definition: NetricsServerInterface.cs:3778
Returns
The ibi™ Patterns - Search Server's version string
Exceptions
NetricsExceptionIf the server indicates that an error has occured

◆ tbldelete()

void NetricsServerInterface.NetricsServerInterface.tbldelete ( String  tblName)
inline

Delete a table.

Call this method to delete an existing table.

This sample shows how to delete an ibi™ Patterns - Search table.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Table to be deleted
String table = "names";
si.tbldelete(table);
Console.WriteLine("Table deleted: " + table);
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
void tbldelete(String tblName)
Delete a table.
Definition: NetricsServerInterface.cs:1827
Parameters
tblNameThe name of the table to be deleted
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLNOTFOUND, EXPECTTBLDESC, NOTBLDESC, NOSYSINIT)

◆ tblload() [1/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.tblload ( NetricsTable  tbl)
inline

Used to load a NetricsTable into the server.

Parameters
tblThe table to be loaded
Returns
The statistics for the table just loaded

This sample shows a way to load an ibi™ Patterns - Search table from a csv file.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// CSV Input file
String file = "c:\\temp\\names_all.csv";
// <i>ibi Patterns - Search</i> table name
String table = "names1";
// Create a NetricsRecFile which points to the CSV input file
NetricsRecFile netricsRecFile = new NetricsRecFile(file);
// Create a NetricsCSVRecSrc which will then read the NetricsRecFile
NetricsCSVRecSrc src = new NetricsCSVRecSrc(netricsRecFile);
// Create a NetricsTable object to define tblload parameters
NetricsTable tbl = new NetricsTable(table, src.getFieldNames(), src);
// Create and load the table
NetricsTableStats response = si.tblload(tbl);
Console.Write(response.getName() + ": " + response.getNumRecs().ToString() + " records loaded.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String[] getFieldNames()
Return the field names of the record data fields.
Definition: NetricsCSVRecSrc.cs:437
This class represents an ibi™ Patterns - Search table.
Definition: NetricsTable.cs:21
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)
See also
NetricsTable

◆ tblload() [2/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.tblload ( NetricsTable  tbl,
bool  doMaxWork 
)
inline

Used to load a NetricsTable into the server.

See also: NetricsTable, NetricsServerInterface.tblload(NetricsTable)

Parameters
tblThe table to be loaded
doMaxWorkprocess as many records as possible, ignoring those with errors.
Returns
The statistics for the table just loaded
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN)

◆ tblload() [3/3]

NetricsTableStats NetricsServerInterface.NetricsServerInterface.tblload ( NetricsTable  tbl,
NetricsRecFile  fileDef 
)
inline

Create and load a table from a server side CSV file.

Parameters
tblDefines table to be loaded. Record source is ignored.
fileDefDefines the name and format of the file Containing the records.
Returns
The statistics for the table just loaded
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, TBLEXISTS, TBLPARAM, RECEXISTS, CHARMAP, DUPFIELDNAMES, EXPECTTBLDESC, EXPECTLIST, EXPECTRECORD, FEATURESET, FIELDLENSUM, NOTBLDESC, NORECKEY, NOSRCHTXT, NUMFIELDS, PARAMCONFLICT, PARAMVAL, SHUTDOWN, FILEFORMAT)
See also
NetricsTable, NetricsRecFile, NetricsServerInterface.tblload(NetricsTable)

Sample code

◆ tblmove()

void NetricsServerInterface.NetricsServerInterface.tblmove ( String  oldName,
String  newName 
)
inline

Rename a table.

Call this method to rename an existing table. Note that if the table with the name

newName

already exists, it will be deleted, and replaced by the table that you are renaming.

This sample shows how to rename an ibi™ Patterns - Search table.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// oldName is the existing table name and newName is the new table name
String oldName = "names1";
String newName = "names";
si.tblmove(oldName, newName);
Console.WriteLine("Table moved");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
void tblmove(String oldName, String newName)
Rename a table.
Definition: NetricsServerInterface.cs:1773
Parameters
oldNameThe name of the table that will be renamed
newNameThe new name of the table
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - TBLMOVESAME, TBLNOTFOUND, EXPECTTBLDESC, FEATURESET, NOTBLDESC, NOSYSINIT)

◆ thcreate()

void NetricsServerInterface.NetricsServerInterface.thcreate ( NetricsThesaurus  thes)
inline

Create a thesaurus in the ibi™ Patterns - Search Server.

This sample shows how to create a thesaurus in an ibi™ Patterns - Search Server.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Thesaurus input csv file
String file = "c:\\temp\\nicknames.csv";
// Thesaurus name
String thesaurus = "nicknames";
// Use default encoding which is LATIN1 specified by the null
NetricsThesaurus thes = new NetricsThesaurus(thesaurus, file, null);
si.thcreate(thes);
Console.WriteLine("Thesaurus created");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
This class contains a list of synonyms that can be used while searching.
Definition: NetricsThesaurus.cs:17
Parameters
thesThe NetricsThesaurus object to create on the ibi™ Patterns - Search Server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)

◆ thdelete()

void NetricsServerInterface.NetricsServerInterface.thdelete ( String[]  theslist)
inline

Delete one or more thesauri currently loaded on the server.

This deletes all of the thesauri given (all thesauri on the server if null is passed).

This sample shows how to delete a thesaurus in an ibi™ Patterns - Search Server.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Delete the nicknames thesaurus. A null will delete all thesauri.
String[] thesList = {"nicknames"};
si.thdelete(thesList);
Console.WriteLine("Thesaurus(es) deleted.");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
void thdelete(String[] theslist)
Delete one or more thesauri currently loaded on the server.
Definition: NetricsServerInterface.cs:1641
Parameters
theslistThe names of the tables to be deleted. Pass null to delete all thesauri on the server.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - NODBDESC, THESNOTFOUND, EXPECTLIST, FEATURESET, PARAMVAL, INTERNAL, NOSYSINIT)

◆ thes_stats()

NetricsThesStats[] NetricsServerInterface.NetricsServerInterface.thes_stats ( String[]  thes_names)
inline

Lists statistics on thesauri currently loaded on the server.

Parameters
thes_namesThe names of the thesauri to be listed. Pass null to list all thesauri on the server.
Returns
An array of NetricsThesStats, one per thesaurus listed or one for each thesaurus loaded on the server.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - THESNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)
See also
NetricsThesStats

◆ thlist()

String[] NetricsServerInterface.NetricsServerInterface.thlist ( )
inline

Lists the thesauruses currently loaded in the ibi™ Patterns - Search Server.

This sample shows how to list all thesauri in an ibi™ Patterns - Search Server.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
String[] response = si.thlist();
String data = null;
for (int i = 0; i < response.Length; i++)
{
data = response[i];
Console.Write("Thesaurus name = " + data + "\n");
}
if (response.Length == 0)
Console.Write("No thesauruses loaded.");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
String[] thlist()
Lists the thesauruses currently loaded in the ibi™ Patterns - Search Server.
Definition: NetricsServerInterface.cs:1695
Returns
An array of Strings, one per thesaurus loaded in the ibi™ Patterns - Search Server.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - THESNOTFOUND, EXPECTLIST, PARAMVAL, NOTBLDESC, NOSYSINIT)

◆ tranAbort()

void NetricsServerInterface.NetricsServerInterface.tranAbort ( long  tran_id)
inline

Abort a transaction.

This method aborts the transaction with the given transaction id. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server.

Exceptions
NetricsExceptionIf the server indicates that an error has occured.

◆ tranCommit()

void NetricsServerInterface.NetricsServerInterface.tranCommit ( long  tran_id)
inline

Commit a transaction.

This method commits the transaction with the given transaction id. If the given transactions has errors this call will fail. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server.

Exceptions
NetricsExceptionIf the server indicates that an error has occured.

◆ tranForceCommit()

void NetricsServerInterface.NetricsServerInterface.tranForceCommit ( long  tran_id)
inline

Commit a transaction even if it has errors.

This method commits the transaction with the given full transaction id, forcing the commit even if there were errors. If the call to the server should fail a NetricsException is thrown, the error code and message being set to the values returned by the server.

Exceptions
NetricsExceptionIf the server indicates that an error has occured.

◆ tranSetIdleOpts()

void NetricsServerInterface.NetricsServerInterface.tranSetIdleOpts ( int  idle_time,
String  action 
)
inline

Set the idle transaction processing parameters on the server.

This method is used to set the parameters that control how idle transactions are treated on the server. Transactions that sit idle for long periods of time can be cleaned up automatically by the server. These parameters define how that clean up processing is performed.

A transaction is idle when no commands are being run under that transaction. The idle time is the time from the completion of the last command associated with the transaction to the present time.

The purpose of idle transaction clean up is to take care of transactions that were abandoned, e.g. an application crashed in the middle of the transaction and thus will never close it. These parameters can be set from command line arguments when the server is started, so generally it is not necessary to do so from the API.

The server doesn't guarantee that a transaction will be cleaned up as soon as it exceeds the idle time. Checks are made on a periodic basis, so transactions may be idle for some seconds past the maximum before they are detected.

Parameters
idle_timeThis defines how many seconds a transaction must sit idle before the clean up action is performed. If this value is zero the max idle time is considered to be infinite (i.e. no clean up is performed). If this value is less than zero the max idle time parameter is left unchanged.
actionThis defines the action to be performed on all transactions that exceed the maximum idle time. It is a one character flag with values: a abort the transaction, c commit the transaction, e abort the transaction if it has errors, otherwise commit the transaction, n do nothing. If this argument is null, an empty string or a single blank character the parameter is left unchanged.
Exceptions
NetricsExceptionIf the server indicates that an error has occured.

◆ updRecsFromFile()

NetricsTableStats NetricsServerInterface.NetricsServerInterface.updRecsFromFile ( String  tblName,
NetricsRecFile  fileDef 
)
inline

Update records from a server side file.

This will add the given records if they do not already exist, or replace them if they do exist.

Parameters
tblNameDefines table to be loaded.
fileDefDefines the name and format of the file Containing the records.
Returns
The statistics for the table after the add or replace operations were performed.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - same as recadd)
See also
NetricsRecFile

◆ wdcreate()

void NetricsServerInterface.NetricsServerInterface.wdcreate ( NetricsWeightedDictionary  wdict)
inline

Create a weighted dictionary in the ibi™ Patterns - Search Server.

A Thesaurus is used for word substitution such as synonyms or related terms.

A Weighted Dictionary is a variant of a Thesaurus which can reduce the contribution of a synonym in the overall score.

A Combined Thesaurus combines the features of a Thesaurus and a Weighted Dictionary and can apply a penalty score to be applied to each Thesaurus class.

This sample code shows how to create a Weighted Dictionary in the ibi™ Patterns - Search Server running on the localhost listening to port 5051.

class MyClass
{
private static NetricsServerInterface.NetricsServerInterface si = null; <br>
public static void Main()
{
try
{
String host = "localhost";
int port = 5051;
// Weighted Dictionary input csv file
String file = "c:\\temp\\wdnames.csv";
//Combined Thesaurus name
String thesaurus = "myThesaurus";
// Use default encoding which is LATIN1 specified by the null
NetricsWeightedDictionary wd = new NetricsWeightedDictionary(thesaurus, file, null);
si.wdcreate(wd);
Console.Write("Weighted dictionary/thesaurus created.\n");
}
catch (NetricsException e)
{
Console.Write(e.getErrorDescription() + "\n");
}
}
}
Objects of this class represent a weighted dictionary, used to define terms with lesser or greater im...
Definition: NetricsWeightedDictionary.cs:22
Parameters
wdictThe NetricsWeightedDictionary object to create on the ibi™ Patterns - Search Server. The name and synonyms of the thesaurus are defined by using the thesaurus object's methods.
Exceptions
NetricsExceptionIf the server indicates that an error has occured (Possible errors - ARRAYLEN, CHARMAP, EXPECTTHESNAME, EXPECTLIST, FEATURESET, IOERROR, PARAMVAL, PARAMMISSING)