7.9.4.2. Filter rules for indexing

[Note]Note

As a rule, a catalog is fully indexed so that no filter rules are required.

If you do not want to index all parts within a catalog, you can define filter rules for this.

Here is an example:

[settings]
GenerationFilterRules=ScriptFilterRule, ScriptFilterRuleErp

[GenerationFilterRule_ScriptFilterRule]
Catalogs=cat/lochplatten_ecat
AlgoTypes=IMG
LineScriptCallbackFile=filter.vbs
LineScriptCallbackFunction=checkLine
IndexTypes=Standard

[GenerationFilterRule_ScriptFilterRuleErp]
Catalogs=cat/lochplatten_ecat
AlgoTypes=IMG
LineScriptCallbackFile=filterErp.vbs
LineScriptCallbackFunction=checkLine
IndexTypes=Erp

Script filter.vbs:

function checkLine(table)
  dim nb = table.selectedRow.getNB()
  checkLine = (InStr(nb, "photo_noerp ") = 0
end function

Script filter_erp.vbs:

function checkLine(table)
  dim nb = table.selectedRow.getNB()
  checkLine = (InStr(nb, "photo_erp ") = 0
end function

[Important]Important

If checkLine returns true, the line is filtered out, i.e. it is not indexed for the photo search. In this example, all parts contained in the NB photo_noerp and all parts with an ERP number contained in the NB photo_erp would have fingerprints for the photo search.

As an alternative to script callbacks, you can also filter using RegExp:

[GenerationFilterRule_LineFilterRule]
Catalogs=cat/lochplatten_ecat
AlgoTypes=IMG
LineFilterCount=1
LineFilterVar0=NB
LineFilterRegExp0=^(?!.*24041 Lg ).*
Conjunction=AND
IndexTypes=Standard

You can also define these filters at project level:

[GenerationFilterRule_ProjectFilterRule]
Catalogs=cat/lochplatten_ecat
AlgoTypes=IMG
IndexTypes=Standard
PrjRegExp=^(?!din_24041_lg\.prj$).*