Taxonomy Rules: Operator Reference
Operators
Use the following table to see an overview of the available rule operators and their functions.
More information is available in the following sections:
Type | Operator |
---|---|
Boolean |
This statement is true whether you specify multiple instances of the same Boolean operator such as
AND can also be chained with NOT where both operators are separated by a space: AND NOT.
The Specify this operator using the FINE TUNE RULEs pane, only ANOT example: The following expression returns a match on input documents that contain the term prerequisites and not the term autoclassifier.
For more examples, see "Examples to Boost Matching Scores," below. |
CASE | Matches the exact case of the input term. Use the CASE operator to match the exact case of every letter in the term. When you specify the CASE operator, you limit the matches on input documents to those documents that contain one or more terms with an exact match on the specified case. For example, to return a match on "prerequisites," but not Prerequisites or PreRequisites, specify:
|
NOSTEM |
Use the For example, to return a match on pre, but not prerequisites, specify:
|
Proximity (NEAR) |
NEAR: Matches only within the specified proximity.
Note: The
NEAR operator is not compatible with the SIMPLE RULE DEVELOPMENT pane. Specify this operator using the FINE TUNE RULEs pane, only.
By default, the |
SOUNDSLIKE |
Use the For example, to return a match on prerequisites, you can specify:
|
Wildcard |
Do not enclose a term and the modifying wildcard in parentheses (
() ).
Notes
Do not use quotation marks ("") to surround your term when you specify a wildcard.
For example, to match litigate, litigation, litigious, litig, and litigating, specify:
For example, to match framework, network, or homework, specify: *work |
Regular expressions | Use with or without special characters such as + , ? , * , and so on. For more information, see Regular Expressions. |
KQLAR syntax |
Use with operators such as For more information, see Key Word Query Language Syntax. Note: KQLAR is the specific variation of KQL operators used by AutoClassifier |
Examples to Boost Matching Scores
public void BoostScoreForRule(float addToScore, string propertyName, RuleType ruleType, LabelMatchType lableMatchType, int hitCountThreshold)
The specified value is added to the final score if there is a match for the specified rule types TermMatch
or NearMatch
, and label types Primary
or Synonym
, the number of hits in the specified field is equal or greater than the hit count threshold provided as the parameter.
For example:
Context.BoostScoreForRule(0.5F, "title", RuleType.TermMatch, LabelMatchType.Primary, 1);
Adds 0.5
to the final score if there is at least one hit on the primary term label in the title of the document.
Context.BoostScoreForRule(0.3F, "body", RuleType.TermMatch, LabelMatchType.Synonym, 5);
Adds 0.3
to the final score if there are at least five hits for any of the term synonym labels.
var allLabelTypes = LabelMatchType.Primary | LabelMatchType.Synonym ; Context.BoostScoreForRule(0.2F, "body", RuleType.NearMatch, allLabelTypes, 8);
Adds 0.2
to the final score if there are at least eight total hits of the NEAR
subqueries configured in the term rule taking into consideration both primary and synonym labels.
public void BoostScoreForRule(float addToScore, string propertyName, LabelMatchType lableMatchType, int hitCountThreshold, int nearProximity)
Adds the specified value to the final score.
This statement is true if in the specified field, for the specified NEAR
query proximity and label type (Primary
or Synonym
), the number of hits is equal to, or greater than, the hit count threshold that is specified as the parameter.
Context.BoostScoreForRule(0.3F, "body", LabelMatchType.Primary, 2, 3);
Adds 0.3
to the final score if there are at least two hits of the proximity 3 NEAR
subquery containing the Primary
term label.
How to Group Terms
Use parentheses "()"
to group terms, using the AND
or OR
Boolean operators, to specify the ordering of the operations that are enclosed by the parentheses.
The following rule example uses parentheses and also relies on the built-tin AutoClassifier stemming feature in order to locate matches in the input documents: