| ibi Patterns .NET API

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
NetricsServerInterface.NetricsTable Class Reference

This class represents an ibi™ Patterns - Search table. More...

## Public Types
enum | PsiDensity { Dense = 0 , Standard = 1 , Sparse = 2 }
| Allowed density settings for PSI prefilters. More...
enum | field_typs { FLDTYP_KEY = 2 , FLDTYP_TEXT = 4 , FLDTYP_SRCHTEXT = 5 , FLDTYP_INT = 6 , FLDTYP_FLOAT = 8 , FLDTYP_DATE = 10 , FLDTYP_SRCHDATE = 11 , FLDTYP_DATETIME = 12 , FLDTYP_ATTRS = 15 , FLDTYPE_PARENTKEY = 16 }
| An enumeration of all the field types. More...

## Public Member Functions
| NetricsTable (String name, String[] fieldNames, NetricsTableRecSrc src)
| Define a standard table.
| NetricsTable (String name, String parent_tbl, String[] fieldNames, NetricsTableRecSrc src)
| Create a standard or child table.
| NetricsTable (String name, bool? is_parent, String[] fieldNames, NetricsTableRecSrc src)
void | setGpuIndexing (bool? enabled)
| Set whether this table uses GPU-accelerated indexing.///.
void | setGpuDevices (int[] device_ids)
| Select the GPU devices this tables uses for GPU-accelerated indexing.
NetricsTableRecSrc | getRecSrc ()
| Return the attached record source.
String | getName ()
| Return the name of this table.
void | setEstNumRecords (int est_num)
| Set the estimated number of records.
void | setInfo (String info)
| Set the table info string.
String | getInfo ()
| Return the info that was set using setInfo()
void | setGipGramLen (int glen)
| This method sets the gram length for the enterprise filer.
void | setGipFiltered (bool enabled)
| Enable GIP filtering for this table.
bool | isGipFiltered ()
| Return true if this table uses the GIP prefilter.
void | setSortFiltered (bool enabled)
| Enable SORT filtering for this table.
bool | isSortFiltered ()
| Return true if this table uses the GIP prefilter.
void | setSortEncodings (String[][] encodings, int[][] backwards_fields)
| Obsolete. Use setSortEncodings(NetricsSortEncoding[]) instead.
void | setSortEncodings (params NetricsSortEncoding[] encodings)
| Specifies encodings for the SORT pre-filter.
void | setPsiFiltered (bool enabled)
| Enable PSI filtering for this table.
bool | isPsiFiltered ()
| Return true if this table uses the PSI prefilter.
void | setPsiEncodings (String[][] encodings, int[][] backwards_fields, int[] suffixed_fields, int[][] min_match_sizes, int?[] densities)
| Obsolete. Use setPsiEncodings(NetricsPsiEncoding[]) instead.
void | setPsiEncodings (String[][] encodings, int[][] backwards_fields, int[] suffixed_fields, int[][] min_match_sizes)
| Obsolete. Use NetricsTable.setPsiEncodings(String[][],int[][],int[],int[][],int?[]) instead.
void | setPsiEncodings (params NetricsPsiEncoding[] encodings)
| Specifies encodings for the PSI pre-filter.
void | setPsiDensity (int density)
| Set the density of suffixes produced from record field values.
void | addPIndex (String field_name, bool primary, String[] partition_separators, bool normalized)
| Add a partition index to this table.
void | setPhonetic (bool enabled)
| Enable phonetic searches for this table.
String[] | getFieldNames ()
| Return the field names.
void | setFieldTypes (int[] ftypes)
| Specify the field types for this table.
void | setCharmaps (String[] charmaps)
String | compare (NetricsTable tbl)
| For internal use only.

## Static Public Attributes
static string | RECORD_LIST_TABLE_NAME = ".Record List."
| The special table name for score records results.

## Detailed Description

This class represents an ibi™ Patterns - Search table.

Its purpose is to allow the user to construct and configure a table object to be loaded into an ibi™ Patterns - Search server.

## Member Enumeration Documentation

## ◆ field_typs

enum NetricsServerInterface.NetricsTable.field_typs

An enumeration of all the field types.

Enumerator
FLDTYP_KEY | Special field type for record key fields. The child record key fields in a joined record have this type.
FLDTYP_TEXT | Non searchable text field.
FLDTYP_SRCHTEXT | Searchable text field. This is the default field type. Inexact matching can only be performed on fields of this type, or FLDTYP_ATTRS
FLDTYP_INT | Integer value field.
FLDTYP_FLOAT | Floating point (double) value field.
FLDTYP_DATE | Date value field.
FLDTYP_SRCHDATE | Indexed date value field. Date fields of this type participate in GIP indexing.
FLDTYP_DATETIME | Date and Time value field.
FLDTYP_ATTRS | Name/Value attributes type field.
FLDTYPE_PARENTKEY | Special field type for parent-key fields. The parent-key field for each child record in a jonied record has this field type.

## ◆ PsiDensity

enum NetricsServerInterface.NetricsTable.PsiDensity

Allowed density settings for PSI prefilters.

The density setting provides a means of trading off space used and query speed for improved accuracy. Dense settings are more likely to find badly mispelled entries at the cost of more memory usage and longer load and query times. Sparse settings consume less memory, load faster and have better query times but are more likely to miss some entries.

Enumerator
Dense | Suffixes are generated for all character positions, up to the maximum. Uses more memory and takes longer to process than PsiDensity.Standard, but may provide better accuracy. ///.
Standard | Suffixes are generated intelligently.
Sparse | Suffixes are generated sparsely. Uses less memory and is quicker to process than PsiDensity.Standard, but may have lower accuracy.

## Constructor & Destructor Documentation

## ◆ NetricsTable() [1/3]

NetricsServerInterface.NetricsTable.NetricsTable | ( | String | name,
|  | String[] | fieldNames,
|  | NetricsTableRecSrc | src
| ) |  |
| inline

Define a standard table.

Parameters

  name | The name of the table. Must be unique. In other commands, the table will be referred to by this name
  fieldNames | User specified names for the fields of the table. In other commands, fields will be referred to by these names
  src | The RecSrc object which holds the records for this table (can be null to load an empty table)

## ◆ NetricsTable() [2/3]

NetricsServerInterface.NetricsTable.NetricsTable | ( | String | name,
|  | String | parent_tbl,
|  | String[] | fieldNames,
|  | NetricsTableRecSrc | src
| ) |  |
| inline

Create a standard or child table.

Parameters

  name | The name of the table. Must be unique. In other commands, the table will be referred to by this name.
  parent_tbl | Name of the parent of this table. If present the named table must exist and be a parent table, and this table is created as a child table. If this is null this table is created as a standard table.
  fieldNames | User specified names for the fields of the the table. In other commands, fields will be referred to by these names
  src | The RecSrc object which holds the records for this table (can be null to load an empty table)

## ◆ NetricsTable() [3/3]

NetricsServerInterface.NetricsTable.NetricsTable | ( | String | name,
|  | bool? | is_parent,
|  | String[] | fieldNames,
|  | NetricsTableRecSrc | src
| ) |  |
| inline

Parameters

  name | The name of the table. Must be unique. In other commands, the table will be referred to by this name
  is_parent | Indicates if this is a parent table.
  fieldNames | User specified names for the fields of the table. In other commands, fields will be referred to by these names
  src | The RecSrc object which holds the records for this table (can be empty to load an empty table)

## Member Function Documentation

## ◆ addPIndex()

void NetricsServerInterface.NetricsTable.addPIndex | ( | String | field_name,
|  | bool | primary,
|  | String[] | partition_separators,
|  | bool | normalized
| ) |  |
| inline

Add a partition index to this table.

This method is used to add a partition index to the table. These indexes can be used to speed the processing of Filtering Predicates. A partition index groups records in the table into a set of partitions based on the value of the named field. The number of partitions and range of values that are placed in each partition must be defined when the index is created. These are defined by the partition_separators parameter.
If you are using filtering predicates, properly defined partition indexes in conjunction with a properly formulated predicate expression can dramatically improve performance on large tables. Consult your ibi support representative to determine the optimal use of partition indexes for your situation.

Parameters

  field_name | The name of the field that is to be indexed.
  primary | If true this is a primary index, otherwise it is a secondary index. Primary indexes give a much better performance improvement, especially on large tables and with highly selective predicates, but at a cost of significantly larger memory requirements and slightly slower load times. The additional memory overhead for a primary index is much larger if more than one primary index is defined for a table. For joined tables, a parent table can have at most one primary index. Although a child table can have one or more primary indexes, the first such index incurs a very large memory overhead. A joined search cannot use a primary index on a child table, only a non-joined search can use such index.
  partition_separators | This is an array that defines the upper bound of each partition. The values MUST be in sorted order (as per the type of the named field) smallest to largest. E.g. for a text field the separators might be all single letters and symbols that the field value can begin with; for a date field they might be dates representing the start of each year, etc. The maximum number of partitions is 1026. As there are two predefined partitions for empty and invalid values and a final partition for values greater than the last separator this limits the total number of separators to 1023.
  normalized | If true and the field is a string value the normalized values are indexed. Thus this index will work with the case insensitive comparison operators and not work with the standard operators.

See also
  NetricsPredicate, NetricsSearchCfg.SetSearchPredicate(String)

## ◆ compare()

String NetricsServerInterface.NetricsTable.compare | ( | NetricsTable | tbl | ) |
| inline

For internal use only.

WARNING: This modifies the record source of tbl.

## ◆ setCharmaps()

void NetricsServerInterface.NetricsTable.setCharmaps | ( | String[] | charmaps | ) |
| inline

    <summary>Specifies the character map to use for each field.</summary>
    <remarks>        The length of this array must be the same as the
                     number of (user) fields in the data base.  This is
                     a list of the names of character maps assigned to
                     each field.  Entries that do not correspond to
                     fields of type LKT_FLD_TYPE_TEXT are ignored.
                     DEFAULT: if not specified all searchable fields use
                              the predefined character map "_STD_".
    </remarks>

Parameters

  charmaps | A string name of the character map to use for each field in the table.

## ◆ setEstNumRecords()

void NetricsServerInterface.NetricsTable.setEstNumRecords | ( | int | est_num | ) |
| inline

Set the estimated number of records.

This method is used to set the estimated number of records in the record source for this table. The server may use this to optimize loading of the records.

## ◆ setFieldTypes()

void NetricsServerInterface.NetricsTable.setFieldTypes | ( | int[] | ftypes | ) |
| inline

Specify the field types for this table.

Use the public constants in this class to set each type.

Field Type | Description
NetricsTable.FLDTYP_TEXT | Non-searchable text
NetricsTable.FLDTYP_SRCHTEXT | Searchable text
NetricsTable.FLDTYP_INT | Integer type field
NetricsTable.FLDTYP_FLOAT | Float type field
NetricsTable.FLDTYP_DATE | Date type field (default format: yyyy/mm/dd), not indexable by GIP prefilter.
NetricsTable.FLDTYP_SRCHDATE | Date type field (default format: yyyy/mm/dd), indexable by GIP prefilter.
NetricsTable.FLDTYP_DATETIME | Date type field, with time (default format: yyyy/mm/dd HH:MM:SS)
NetricsTable.FLDTYP_ATTRS | Name/Value attributes type field

You can't set a field to the special FLDTYP_KEY or FLDTYP_PARENTKEY field types.

Parameters

  ftypes | the array of field types. The length of the array must be the same as the number of fields in the table.

## ◆ setGipFiltered()

void NetricsServerInterface.NetricsTable.setGipFiltered | ( | bool | enabled | ) |
| inline

Enable GIP filtering for this table.

If enabled is set to true the created table will use the GIP prefilter. If set to false the GIP prefilter is not used.

A ibi™ Patterns - Search server has a default prefilter for all tables created on the server. This is normally the GIP prefilter, but can be set to one of the other prefilters when the server is started (see the installation guide). When a table is created the prefilter to use can be specified explicitly using the setGipFiltered, setSortFiltered, and setPsiFiltered methods. Only one of these methods can be set true for particular table. To create a table with no prefilter all methods should be set false.

For a table of any significant size it is strongly recommended that a prefilter be used. Without a prefilter query times on even relatively small tables will be excessive. For more information on prefilters see the ibi™ Patterns - Search Concept Guide.

Parameters

  enabled | if true use the GIP prefilter, if false do not use the GIP prefilter.

See also
  NetricsTable.setSortFiltered(bool), NetricsTable.setPsiFiltered(bool)

## ◆ setGipGramLen()

void NetricsServerInterface.NetricsTable.setGipGramLen | ( | int | glen | ) |
| inline

This method sets the gram length for the enterprise filer.

Only change this at the request of your ibi support representative.

## ◆ setGpuDevices()

void NetricsServerInterface.NetricsTable.setGpuDevices | ( | int[] | device_ids | ) |
| inline

Select the GPU devices this tables uses for GPU-accelerated indexing.

Attempting to select GPU devices when the server does not support GPU acceleration will result in a FEATURESET error.

The device ids must be values returned by TIB_patterns -C LIST.

Parameters

  device_ids | The GPU devices to use. Pass null or an empty array to use the server default.

## ◆ setGpuIndexing()

void NetricsServerInterface.NetricsTable.setGpuIndexing | ( | bool? | enabled | ) |
| inline

Set whether this table uses GPU-accelerated indexing.///.

Parameters

  enabled | True: Enable GPU-accelerated indexing. False: Disable GPU-accelerated indexing. null: Use the server default.

Attempting to enable GPU-acceleration when the server does not support it will result in a FEATURESET error.

## ◆ setInfo()

void NetricsServerInterface.NetricsTable.setInfo | ( | String | info | ) |
| inline

Set the table info string.

This string can be used to associate information with the table as a whole (i.e. title, url). It can then be accessed by calling the list command of the NetricsServerInterface class.

See also
  NetricsServerInterface.list(string[])

## ◆ setPhonetic()

void NetricsServerInterface.NetricsTable.setPhonetic | ( | bool | enabled | ) |
| inline

Enable phonetic searches for this table.

Available only in the Phonetics Version of the ibi™ Patterns - Search Server. Phonetics must be enabled at load time to perform phonetic searches on a table.

## ◆ setPsiDensity()

void NetricsServerInterface.NetricsTable.setPsiDensity | ( | int | density | ) |
| inline

Set the density of suffixes produced from record field values.

It is recommended that you contact your ibi support representative for advice before using this option.

Parameters

  density | See NetricsTable.PsiDensity

## ◆ setPsiEncodings() [1/2]

void NetricsServerInterface.NetricsTable.setPsiEncodings | ( | params NetricsPsiEncoding[] | encodings | ) |
| inline

Specifies encodings for the PSI pre-filter.

It is recommended that you contact your ibi support representative for advice on which encodings to use for your specific application.

Parameters

  encodings | The encodings to use. In general, you should have at least as many encodings as the number of fields in the table and use all important fields as the primary key in at least one encoding.

## ◆ setPsiEncodings() [2/2]

void NetricsServerInterface.NetricsTable.setPsiEncodings | ( | String | encodings[][],
|  | int | backwards_fields[][],
|  | int[] | suffixed_fields,
|  | int | min_match_sizes[][],
|  | int?[] | densities
| ) |  |
| inline

Obsolete. Use setPsiEncodings(NetricsPsiEncoding[]) instead.

It is recommended that you contact your ibi support representative for advice on which PSI encodings to use for your specific application.

Parameters

  encodings | Each string array is a list of field names which will be used for a given PSI encoding. The first field name will be the primary PSI key, the second field will be secondary, and so on. In general, you should have as many encodings as the number of fields in the table and use all important fields as the primary PSI key in at least one encoding.
  backwards_fields | Fields can also be sorted backwards (from the last characters in the field to the first). Important fields can and should be used as primary PSI keys in both their forward and reverse directions. The backwards_fields array should be the same length as the encodings array and the subarray at each position in the two primary arrays should also be the same length. In this way, there is an integer in the backwards_fields arrays for each of the fields in the encodings arrays. The integer is set to 1 if the field is to be sorted in the backwards direction and one for the forward direction.
  suffixed_fields | Indicates the number of fields in each encoding to which suffixing is applied. Currently PSI only supports suffixing the first field, so the entries of this array must be 0 or 1.
  min_match_sizes | Indicates the minimum match size for each field of each encoding. Match sizes are in characters for text fields, and in bytes for non-text fields. A candidate record is rejected if none of the minima are met. Like backwards_fields this array must have the same dimensions as encodings.
  densities | Indicates the suffix-density of each encoding.

## ◆ setPsiFiltered()

void NetricsServerInterface.NetricsTable.setPsiFiltered | ( | bool | enabled | ) |
| inline

Enable PSI filtering for this table.

If enabled is set to true the created table will use the PSI prefilter. If set to false the PSI prefilter is not used.

A ibi™ Patterns - Search server has a default prefilter for all tables created on the server. This is normally the GIP prefilter, but can be set to one of the other prefilters when the server is started (see the installation guide). When a table is created the prefilter to use can be specified explicitly using the setGipFiltered, setSortFiltered, and setPsiFiltered methods. Only one of these methods can be set true for particular table. To create a table with no prefilter all methods should be set false.

For a table of any significant size it is strongly recommended that a prefilter be used. Without a prefilter query times on even relatively small tables will be excessive. For more information on prefilters see the ibi™ Patterns - Search Concept Guide.

Parameters

  enabled | if true use the PSI prefilter, if false do not use the PSI prefilter.

See also
  NetricsTable.setSortFiltered(bool), NetricsTable.setGipFiltered(bool)

## ◆ setSortEncodings() [1/2]

void NetricsServerInterface.NetricsTable.setSortEncodings | ( | params NetricsSortEncoding[] | encodings | ) |
| inline

Specifies encodings for the SORT pre-filter.

It is recommended that you contact your ibi support representative for advice on which sort encodings to use for your specific application.

Parameters

  encodings | The encodings to use. In general, you should have as many encodings as the number of fields in the table and use all important fields as the primary sort key in at least one encoding.

## ◆ setSortEncodings() [2/2]

void NetricsServerInterface.NetricsTable.setSortEncodings | ( | String | encodings[][],
|  | int | backwards_fields[][]
| ) |  |
| inline

Obsolete. Use setSortEncodings(NetricsSortEncoding[]) instead.

It is recommended that you contact your ibi support representative for advice on which sort encodings to use for your specific application.

Parameters

  encodings | Each string array is a list of field names which will be used for a given sort encoding. The first field name will be the primary sort key, the second field will be secondary, and so on. In general, you should have as many encodings as the number of fields in the table and use all important fields as the primary sort key in at least one encoding.
  backwards_fields | Fields can also be sorted backwards (from the last characters in the field to the first). Important fields can and should be used as primary sort keys in both their forward and reverse directions. The backwards_fields array should be the same Length as the encodings array and the subarray at each position in the two primary arrays should also be the same Length. In this way, there is an integer in the backwards_fields arrays for each of the fields in the encodings arrays. The integer is set to 1 if the field is to be sorted in the backwards direction and 0 for the forward direction.

## ◆ setSortFiltered()

void NetricsServerInterface.NetricsTable.setSortFiltered | ( | bool | enabled | ) |
| inline

Enable SORT filtering for this table.

If enabled is set to true the created table will use the SORT prefilter. If set to false the SORT prefilter is not used.

A ibi™ Patterns - Search server has a default prefilter for all tables created on the server. This is normally the GIP prefilter, but can be set to one of the other prefilters when the server is started (see the installation guide). When a table is created the prefilter to use can be specified explicitly using the setGipFiltered, setSortFiltered, and setPsiFiltered methods. Only one of these methods can be set true for particular table. To create a table with no prefilter all methods should be set false.

For a table of any significant size it is strongly recommended that a prefilter be used. Without a prefilter query times on even relatively small tables will be excessive. For more information on prefilters see the ibi™ Patterns - Search Concepts Guide.

Parameters

  enabled | if true use the SORT prefilter, if false do not use the SORT prefilter.

See also
  NetricsTable.setGipFiltered(bool), NetricsTable.setPsiFiltered(bool)