|
ibi Patterns .NET API
|
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. | |
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.
An enumeration of all the field types.
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.
|
inline |
Define a standard table.
| 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) |
|
inline |
Create a standard or child table.
| 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) |
|
inline |
| 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) |
|
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.
| 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. |
|
inline |
For internal use only.
WARNING: This modifies the record source of tbl.
|
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>
| charmaps | A string name of the character map to use for each field in the table. |
|
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.
|
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.
| ftypes | the array of field types. The length of the array must be the same as the number of fields in the table. |
|
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.
| enabled | if true use the GIP prefilter, if false do not use the GIP prefilter. |
|
inline |
This method sets the gram length for the enterprise filer.
Only change this at the request of your ibi support representative.
|
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.
| device_ids | The GPU devices to use. Pass null or an empty array to use the server default. |
|
inline |
Set whether this table uses GPU-accelerated indexing.///.
| enabled |
|
Attempting to enable GPU-acceleration when the server does not support it will result in a FEATURESET error.
|
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.
|
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.
|
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.
| density | See NetricsTable.PsiDensity |
|
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.
| 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. |
|
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.
| 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. |
|
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.
| enabled | if true use the PSI prefilter, if false do not use the PSI prefilter. |
|
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.
| 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. |
|
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.
| 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. |
|
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.
| enabled | if true use the SORT prefilter, if false do not use the SORT prefilter. |