This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Home > Class Reference > %SYS namespace > %iKnow.Filters.DictionaryMatchFilter

%iKnow.Filters.DictionaryMatchFilter

class %iKnow.Filters.DictionaryMatchFilter extends %iKnow.Filters.Filter

%iKnow.Filters.Filter implementation selecting sources based on whether they contain a minimum and/or maximum number or total score of dictionary matches.

NOTE: by default, this filter only uses existing match results and will only ensure all sources are fully matched when the ensureMatched parameter is enabled!

Filter parameters:

  1. domainId As %Integer
  2. dictIds As %List - target dictionaries (ORed together). Use negative IDs to refer to cross-domain dictionaries.
  3. min As %Numeric (default 1) - minimum count or total score (-1 = no minimum)
  4. max As %Numeric (default -1) - maximum count or total score (-1 = no maximum)
  5. metric As %String (["COUNT"|"SCORE"], default "COUNT") - whether to take the number of matches (default) or their aggregated score.
  6. ensureMatched As %Integer - controls whether or not all sources in the domain are matched through an explicit call to MatchingAPI.MatchSources() as follows:
    • 0 - no explicit matching, use current matching results (default)
    • 1 - match before every invocation of the filter (warning: significant performance impact!)
    • 2 - match once when the filter is instantiated

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property DictIds as %List;
Property methods: DictIdsGet(), DictIdsIsValid(), DictIdsLogicalToOdbc(), DictIdsOdbcToLogical(), DictIdsSet()
property EnsureMatched as %Integer;
Property methods: EnsureMatchedDisplayToLogical(), EnsureMatchedGet(), EnsureMatchedIsValid(), EnsureMatchedLogicalToDisplay(), EnsureMatchedNormalize(), EnsureMatchedSet()
property Max as %Numeric;
Property methods: MaxDisplayToLogical(), MaxGet(), MaxIsValid(), MaxLogicalToDisplay(), MaxNormalize(), MaxSet()
property Metric as %String;
Property methods: MetricDisplayToLogical(), MetricGet(), MetricIsValid(), MetricLogicalToDisplay(), MetricLogicalToOdbc(), MetricNormalize(), MetricSet()
property Min as %Numeric;
Property methods: MinDisplayToLogical(), MinGet(), MinIsValid(), MinLogicalToDisplay(), MinNormalize(), MinSet()

Methods (Including Private)

private method %OnNew(domainId As %Integer, dictIds As %List, min As %Numeric = 1, max As %Numeric = -1, metric As %String = "COUNT", ensureMatched As %Integer = 0) as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

private method BuildSourceFilter(maxOffset As %Integer) as %Status
Inherited description:

This is the primary method that needs to be implemented by an actual %iKnow.Filters.Filter subclass to translate the abstract filter criteria the subclass addresses into a bitstring based on Source IDs. The subclass' implementation of this method should use SetSourceBits() for this purpose, setting the requested bitstrings for each offset up to maxOffset.

method Invalidate(type As %Integer = $$$IKFSOURCE) as %Status

If EnsureMatched=2, filter invalidation (for example as the result of new sources being added to the domain) implies matching all sources.

method ToString() as %String
Inherited description:

Subclasses should implement this method to build a string representation of the filter instance. It should start with the filter class name, followed by a pipe (|) character and then a string representation that can be interpreted by its RestoreFilterFromStringInternal() implementation.

private method Validate(type As %Integer = $$$IKFSOURCE, Output isValid As %Boolean = 0) as %Status

In addition to default %iKnow.Filters.Filter checks, this class ensures match status is up to date for the sources at the supplied offset.

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

Subclasses

FeedbackOpens in a new window