|
ibi Patterns .NET API
|
This class is used to configure search options which apply for the overall search (for all tables being searched). More...
Public Types | |
| enum | score_types { SCORE_NORMAL = 0 , SCORE_SYMMETRIC = 1 , SCORE_REVERSE = 2 , SCORE_MIN = 3 , SCORE_MAX = 4 , SCORE_IT = 5 } |
| An enumeration of all possible score types. More... | |
| enum | tiebreak_types { TIEBREAK_RECLEN =1 , TIEBREAK_RECID , TIEBREAK_ALIGNMENT , TIEBREAK_SCORETYPE , TIEBREAK_FIELDVAL } |
| An enumeration of all possible tiebreak types. More... | |
Public Member Functions | |
| NetricsSearchOpts () | |
| Constructs empty opts object. | |
| void | setGpuEnabled (Boolean? enabled) |
| Set whether the search uses GPU-enabled indexing. | |
| void | setGpuCallParallelism (int? count) |
| Set the number of simultaneous GPU calls used in the search. | |
| void | setGpuTableBlocksPerCall (int? count) |
| Set the number of table-blocks evaluated per GPU call. | |
| void | allowEmptyQueries (bool allow) |
| Sets whether queries with no searchable text throw an exception or return an empty result set. The default is to throw an exception. The text of a query is all of the query strings in all Simple, Cognate, and Variable-attribute queries. A query has no searchable text when all of these strings, after applying the appropriate character-maps, contain only white-space. | |
| bool | emptyQueriesAllowed () |
| void | setSortLookupFields (String[] fields) |
| Set the fields used to lookup a record in the sort filter. | |
| void | setPsiLookupFields (String[] fields) |
| Set the fields used to lookup a record in the sort filter. | |
| void | setPsiDensity (NetricsTable.PsiDensity density) |
| Set the density of suffixes produced from query field values. It is recommended that you contact your ibi representative for advice before using this option. | |
| void | setRlModelName (String name) |
| This method specifies the rlink model name to use for this search. | |
| void | setRlPreds (NetricsPredicate[] preds) |
| Set the predicates used as features by the ibi™ Patterns - Search Learn Model. | |
| void | setDetailedStats (bool enabled) |
| Enable detailed statistics for this search. | |
| void | setGipFiltered (bool enabled) |
| void | setSortFiltered (bool enabled) |
| void | setPsiFiltered (bool enabled) |
| void | setPhonetic (bool enabled) |
| Enable phonetic searches for this table. | |
| void | setVisStyle (int styleNo) |
| Sets the visualization style you want returned. | |
| void | setMatchesRequested (int matchesRequested) |
| Set the number of matches returned by the ibi™ Patterns - Search Server (default 10). | |
| void | setStartMatch (int startMatch) |
| Set the rank of the first match to be returned by the ibi™ Patterns - Search Server (default 1). | |
| void | scoreType (score_types scoreType) |
| This specifies the type of score to be used for ordering records. | |
| void | scoreType (int scoreType) |
| Obsolete. Use NetricsSearchOpts.scoreType(NetricsSearchOpts.score_types) instead. | |
| void | useAbsoluteCutoff (double val) |
| Cut off the result set at a specific absolute value. | |
| void | useExactPlusScoreCutoff (int val) |
| Return all search results which are exact matches and a constant number of records which are inexact. | |
| void | usePercentOfTopCutoff (double val) |
| Return search results whose scores are above a given percentage of the score of the first record. | |
| void | useSimpleGapCutoff (double val) |
| Return search results until there is gap between adjacent records. | |
| void | useNoCutoff () |
| Revert to not using a cutoff. | |
| void | setMatchEmpty (bool value) |
| Sets the flag to match empty values. | |
| void | setEmptyScore (double score) |
| Sets the score a comparison gets when empty data is encountered. | |
| void | setInvalidScore (double score) |
| Sets the score a comparison gets when an error occurs. | |
| void | setFailEmptyPred (bool fail) |
| Set whether the predicate fails on empty data. | |
| void | setFailInvalidPred (bool fail) |
| Set whether a failed predicate is considered true or false. | |
| void | baseColor (String color) |
| Specify a non-match color for HTML text. | |
| void | matchColor (String color) |
| Specify a match color for HTML text. | |
| void | baseBgColor (String color) |
| Specify a background non-match color for HTML text. | |
| void | matchBgColor (String color) |
| Specify a background match color for HTML text. | |
| void | maxFontSize (int val) |
| Specify the maximum font size of matching text. | |
| void | italicsThresh (int val) |
| Specify the threshold beyond which to italicize text. | |
| void | boldThresh (int val) |
| Specify the threshold beyond which to bold text. | |
| void | underlineThresh (int val) |
| Specify the threshold beyond which to underline text. | |
| void | useThesaurus (String name) |
| Use the specified thesaurus in determining matching records. | |
| void | useEphemeralThesaurus (NetricsBaseThesaurus thes_def) |
| Use an empheral thesaurus in determining matching records. | |
| void | setThesaurusWeight (double weight) |
| Use the specified thesaurus weight in determining matching records. | |
| void | addCustomTiebreak (int tiebreakId, int tiebreakParam) |
| Can be used to specify how to break ties between two records that have identical textual similarity. | |
| void | setFetchSize (int size) |
| Tuning parameter, use only on the advice of your ibi representative. | |
| void | setPCSize (int size) |
| Tuning parameter, use only on the advice of your ibi representative. | |
| void | setQCSize (int size) |
| Tuning parameter, use only on the advice of your ibi representative. | |
| void | setXparm (int id, int val) |
| Use this method only on the advice of your ibi Patterns support representative. | |
| void | setXparm (int id, double val) |
| Use this method only on the advice of your ibi Patterns support representative. | |
This class is used to configure search options which apply for the overall search (for all tables being searched).
An enumeration of all possible score types.
An enumeration of all possible tiebreak types.
|
inline |
Can be used to specify how to break ties between two records that have identical textual similarity.
Each tiebreaking option has integer identifier and a possible integer parameter (most ignore the parameter). The tiebreaks are given in the table below.
| NetricsSearchOpts.tiebreak_types.TIEBREAK_RECLEN | Deprecated. This is identical to TIEBREAK_SCORETYPE on symmetric score. | ignored |
| NetricsSearchOpts.tiebreak_types.TIEBREAK_RECID | By record key - this can be used to guarantee a stable sort of tied records | ignored |
| NetricsSearchOpts.tiebreak_types.TIEBREAK_ALIGNMENT | By querylet alignment - records which the query matches closer to the beginning will come first. This applies only to cognate or simple queries. | ignored |
| NetricsSearchOpts.tiebreak_types.TIEBREAK_SCORETYPE | By scoretype - you can tiebreak by a different scoretype than you're sorting on | The scoretype - described in NetricsSearchOpts.sortScore |
| NetricsSearchOpts.tiebreak_types.TIEBREAK_FIELDVAL | By field value - strings will be sorted from high to low and numeric values from low to high | The integer value of the field number to use (zero based) |
Any number of tiebreaks may be added. The first tiebreak added will be the primary sort, the second will be the secondary sort, and so on (e.g. if the records are still tied after the first tiebreak, the second will then be used).
| tiebreakId | One of the Ids specified in the table above. |
| tiebreakParam | An int parameter which is explained in the table above. |
|
inline |
Sets whether queries with no searchable text throw an exception or return an empty result set. The default is to throw an exception.
The text of a query is all of the query strings in all Simple, Cognate, and Variable-attribute queries. A query has no searchable text when all of these strings, after applying the appropriate character-maps, contain only white-space.
| allow | When true, queries with no search text will return an empty result set. When false, queries with no search text will throw a NetricsException with code NetricsException.error_codes.NOQUERY. |
|
inline |
Specify a background non-match color for HTML text.
Because ibi™ Patterns - Search returns a score per character in the matching record (see getCharMatchStrengths), the matching characters can be visualized based on the strength of the match at that position. For instance, the color red can be used to signify a strong match and the color blue can be used to signify a weak match. A gradient between the two colors can then be used to show matches of varying strengths. if you specify any of the following parameters, the visualization process will be done for you, and returned in the form of an HTML string per field in the record. The HTML strings can be accessed using the getHTMLStringByIndex method of the Record object. Each of the following parameters is used to customize the appearance of the HTML visualization.
| color | The background color for a match can also be changed to indicate a match. This parameter represents the background color used to indicate a weak match. |
|
inline |
Specify a non-match color for HTML text.
| color | All colors are specified as they are in an HTML document. The String should have 6 characters, each of which is a hex value (from 0 to F). The first two characters represent red, the second two represent green, and the last two represent blue. This parameter represents the color used to indicate a weak match. |
|
inline |
Specify the threshold beyond which to bold text.
| val | This parameter represents the score for a character over which characters will be bolded (scores for characters returned from ibi™ Patterns - Search have a score from 0 to 6). |
Sample code of setting some search options
|
inline |
|
inline |
Specify the threshold beyond which to italicize text.
| val | This parameter represents the score for a character over which characters will be italicized (scores for characters returned from ibi™ Patterns - Search have a score from 0 to 6). |
Sample code of setting some search options
|
inline |
Specify a background match color for HTML text.
| color | This parameter represents the background color used to indicate a strong match. |
|
inline |
Specify a match color for HTML text.
| color | This parameter represents the color used to indicate a strong match. |
|
inline |
Specify the maximum font size of matching text.
| val | This parameter represents the HTML font size to use for strong matches (ranges from 0 to 3). |
|
inline |
This specifies the type of score to be used for ordering records.
Score types include the following:
Normal (pass in NetricsSearchOpts.score_types.SCORE_NORMAL). This is the standard ibi™ Patterns - Search search with all weights and penalties applied. This type of search looks for the query text inside the record text. The presence of extra information in the record not found in the query does not penalize the record score. Use this score type for a substring or keyword search.
Symmetric (pass in NetricsSearchOpts.score_types.SCORE_SYMMETRIC). A symmetric search compares the full texts of both the query and record and evaluates their similarity. If the record contains information not present in the query, the score will be lower than if that information had not been present. Use this score only when the query represents the entirety of the text expected to be found.
Reverse (pass in NetricsSearchOpts.score_types.SCORE_REVERSE). Reverse scoring functions the same as the normal search, but with the roles of the record and query reversed. Records are selected based on how well they match some piece of the query, with no penalty for unmatched sections of the query. Use this score type to categorize documents by using the document as a query against a table consisting of records of known keywords.
Minimum ( pass in NetricsSearchOpts.score_types.MINIMUM). Minimum of normal and reverse scores.
Maximum ( pass in NetricsSearchOpts.score_types.MAXIMUM). Maximum of normal and reverse scores.
Scoreit ( pass in NetricsSearchOpts.score_types.SCORE_IT). All five score types are computed and returned for each record and can be accessed using the getNormMatchScore, getRevMatchScore, getSymMatchScore, getMinMatchScore, and getMaxMatchScore NetricsSearchResult methods. The getMatchScore method holds a copy of whichever match score was used to select and sort the records in the list.
This sample code shows how to specify search options such as scoretype on a multi-query operation.
|
inline |
Enable detailed statistics for this search.
Detailed statistics will return information which can be used by your ibi Patterns support representative, but should be off by default as it will decrease search performance.
|
inline |
Sets the score a comparison gets when empty data is encountered.
A comparison will receive this score when empty data is encountered. In some situations it is more appropriate to set this score to 0.0 or -1.0, and the user is therefore allowed to configure this setting.
This sample code shows how to specify search options such as emptyscore on a multi-query operation.
|
inline |
Set whether the predicate fails on empty data.
This applies to filtering predicates. If this is true predicates that encounter empty data, either in the query or record value, fail. The treatment of the failed predicate is then controlled by the setting of the Invalid Predicate flag. If this is false the predicate is evaluated against the empty data assuming a default value appropriate to the data type of the field.
The default value for this flag is true.
|
inline |
Set whether a failed predicate is considered true or false.
This applies to filtering predicates. It controls how failed predicates are treated. A predicate fails if:
An invalid data value, either in the query or record data, is encountered.
An empty date value, either in the query or record data, is encountered and the Fail Empty Predicate flag is true.
A conversion is requested on data that can't be converted to the requested type.
Other rare conditions may cause a failure.
If this flag is true a failed predicate is treated as a false value, i.e. the record is not returned. If this value is false a failed predicate is treated as true, i.e. the test is considered to have passed even if other clauses in the test returned false.
For example:
If the value of "issue-date" is "notadate", causing the conversion to fail, and the Fail Invalid Predicate flag is set to false, the test returns true even if "count" is greater then 10.
This flag should be set to false only after careful consideration of the above.
The default value is true.
|
inline |
Enable GIP filtering for this table (default). Available only if the GIP filter was enabled in the server and the table was loaded with GIP filtering enabled. GIP filtering will greatly speed up the performance of the server for large data sets.
| enabled | new value for the GIP filtering setting. |
|
inline |
Set the number of simultaneous GPU calls used in the search.
| count | The number of simultaneous GPU calls used in the search. Pass null to use the server's default value. |
See the programmers guide for default and limits.
|
inline |
Set whether the search uses GPU-enabled indexing.
| enabled | True: use gpu-enabled indexing. If the table is not gpu-enabled the search will fail.False: do not use gpu-enabled indexing.null: use gpu-enabled indexing only if the table is gpu-enabled. |
|
inline |
Set the number of table-blocks evaluated per GPU call.
| count | The number of table-blocks evaluated per GPU call. Pass null to use the server's default value. |
See the programmers guide for default and limits.
|
inline |
Sets the score a comparison gets when an error occurs.
A comparison will receive this score when an error occurs such as an invalid date in a date type field or invalid data in a numerics type field. In some situations it is more appropriate to set this score to 0.0 or -1.0, and the user is therefore allowed to configure this setting.
This sample code shows how to specify search options such as invalidscore on a multi-query operation.
|
inline |
Sets the flag to match empty values.
This is the same as the NetricsQuery.setMatchEmpty(bool) method, but applies to all querylets that do not explicitly set their own Match Empty flag.
value - the value of the Match Empty flag.
|
inline |
Set the number of matches returned by the ibi™ Patterns - Search Server (default 10).
| matchesRequested | The number of matches requested |
|
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 (it is on by default in a Phonetics version server).
|
inline |
Set the density of suffixes produced from query field values. It is recommended that you contact your ibi representative for advice before using this option.
| density | See NetricsTable.PsiDensity |
|
inline |
Enable PSI filtering for this table. Available only if the PSI filter was enabled in the server and the table was loaded with PSI filtering enabled. PSI filtering will greatly speed up the performance of the server for large data sets. To use PSI filtering it must be enabled at load time, and setPsiLookupFields() must be called.
| enabled | new value for the PSI filtering setting. |
|
inline |
Set the fields used to lookup a record in the sort filter.
You should only use this method with the help of your ibi technical support representative.
As the sortfilter is predominantly used in a record linking scenario, a query of the it is expected to contain the same structure as the fields of the table, Therefore, the number and structure of fields in this array must be the same as that for the table.
|
inline |
This method specifies the rlink model name to use for this search.
You should only use this method with the help of your ibi technical support representative.
When you are using a Learn Model, you must use the same query structure that was used to create it. For instance, if there were five features used to train the model, five features which represent the same meaning must still be used. In the simplest case, a five featured model will translate to five querylets. The user would simply call AddQuery five times with the appropriate fields, the querylet scores would automatically be used as feature scores, and the user would receive a Learn Model score in the NetricsSearchResult objects (see getRlScore). If more complicated features were used in the construction of the model, they should also be used when querying the model. To understand this, see setRlQueryletKey and setRlPreds.
|
inline |
Set the predicates used as features by the ibi™ Patterns - Search Learn Model.
You should only use this method with the help of your ibi technical support representative.
It is often useful to specify features in a Learn Model using a strict 1.0/0.0 scoring. ibi™ Patterns - Search inexact matching technology is therfore inappropriate for this. Instead, you should use NetricsPredicates to specify strict conditions constructed from the fields of the query and table. If the predicate evaluates to true, the feature score will equal 1.0. Otherwise it will equal 0.0. For instance, this would be used if you wanted a feature to indicate that the gender of the query record is the same as that of the table record.
|
inline |
Enable SORT filtering for this table. Available only if the SORT filter was enabled in the server and the table was loaded with SORT filtering enabled. SORT filtering will greatly speed up the performance of the server for large data sets. To use SORT filtering it must be enabled at load time, and setSortLookupFields() must be called.
| enabled | new value for the SORT filtering setting. |
|
inline |
Set the fields used to lookup a record in the sort filter.
You should only use this method with the help of your ibi technical support representative.
As the sortfilter is predominantly used in a record linking scenario, a query of the it is expected to contain the same structure as the fields of the table, Therefore, the number and structure of fields in this array must be the same as that for the table.
|
inline |
Set the rank of the first match to be returned by the ibi™ Patterns - Search Server (default 1).
For instance, if startMatch is set to 11 and matchesRequested is set to 10, the server will return matches 11 through 20.
| startMatch | The rank of the first match. |
|
inline |
Use the specified thesaurus weight in determining matching records.
| weight | Specifies a thesaurus weight to use for the query (from 0.0 to 1.0). A weight of 1.0 means that the score associated with a matching thesaurus word will be exactly equivalent to the score which matches the query as entered. If a weight less than 1.0 is given, then the score of records matched based on thesaurus substitutions will be decreased. |
|
inline |
Sets the visualization style you want returned.
The definition is as follows:
| 0: | no visualization (default) |
| 2: | return the match strength arrays in the NetricsSearchResults object. |
| 256: | Return the HTML visualization strings. |
This sample code shows how to specify search options such as setVisStyle on a multi-query operation.
|
inline |
Specify the threshold beyond which to underline text.
| val | This parameter represents the score for a character over which characters will be underlined (scores for characters returned from ibi™ Patterns - Search have a score from 0 to 6). |
Sample code of setting some search options
|
inline |
Cut off the result set at a specific absolute value.
If one wants to use one of the dynamic cutoffs below as well as an absolute cutoff, post-processing the results to enforce the absolute cutoff may be better than setting it here.
| val | The percentage at which to cut off. |
Sample code of setting some search options
|
inline |
Use an empheral thesaurus in determining matching records.
An ephmeral thesaurus is on that exists only for the duration of a single query and is accessible ony by that query. The thesaurus name, although required for consistency, is not used. Thus ephemeral thesauri may have the same name as a permanent thesaurus or another ephemeral thesaurus without causing interference.
Ephemeral thesauri are inteded for those cases where possible sutstitutions or weighted terms for a query are generated dynamically based on the query and is not a fixed set of substitutions or weightings that can be encoded into a static thesaurus.
| thes_def | A Thesarus object (any extension of NetricsBaseThesaurus). |
|
inline |
Return all search results which are exact matches and a constant number of records which are inexact.
Because it is inappropriate to cut off search results at a static score threshold, there are several configurable dynamic methods which can be used. All cutoffs will use the score type specified in the scoreType property. Only one cutoff may be used at a time. The most recent cutoff specified is the one that will be used.
This cutoff returns all exact matches plus a constant number of records.
This sample code shows how to specify search options such as useExactPlusScoreCutoff to limit the the size of the output on a multi-query operation.
| val | The number of records to return in addition to the exact matches. |
|
inline |
Revert to not using a cutoff.
This method is used to specify that no cutoff should be used. Although this happens by default, the useNoCutoff method can be useful after a call to one of the above methods.
Sample code of setting some search options
|
inline |
Return search results whose scores are above a given percentage of the score of the first record.
This cutoff returns the first match plus all record above a certain percentage of the first match.
| val | The percentage of the first records score for which no records below that score will be returned. (Valid range is from 0.0 to 100.0) |
Sample code of setting some search options
|
inline |
Return search results until there is gap between adjacent records.
This cutoff returns the first match and all records until a gap is found between the scores of consecutive records greater than a certain percentage of the score of the first record.
| val | The percentage of the first record's score which will be used to look for a gap between the scores of consecutive records below which no records will be returned. (Valid range is from 0.0 to 100.0) |
Sample code of setting some search options
|
inline |
Use the specified thesaurus in determining matching records.
This sample shows how to perform a search of an ibi™ Patterns - Search table and apply a thesaurus to a query.
| name | Specifies which thesaurus to use for the query. The string should be the name of the thesaurus as passed to the thCreate method of the NetricsServerInterface object. |