3 Comparison Type - DAM v4.8.0
- Emilis Bliudzius (Unlicensed)
- Jeppe Bo Bartel (Unlicensed)
A Comparison Type determines how aĀ Filter does its filtering.Ā
AĀ filter'sĀ Comparison TypeĀ is defined during the creation of theĀ filter:
Creation of a filter
TheĀ Comparison TypeĀ of aĀ filter can be edited in the The Details panel.
There are 22 different Comparison Types:Ā
3.1 FreeText
This Comparison Type is unique. All Filters with aĀ FreeTextĀ Comparison TypeĀ are gathered into a single filterĀ with an ID of "freetext".Ā
Example:
AĀ searchĀ with a singleĀ free text filter:
And to keep it simple, theĀ DAM Center, which is used in this example, only has one asset:
TheĀ title of theĀ assetĀ is "Hydrangeas".
Because theĀ search only has oneĀ free text filter, the string, which the parameter is compared to, will be "Hydrangeas".
The asset has twoĀ keywords: "flower" and "summer", so if you were to add aĀ Keywords free text filter,Ā the string, which the parameter is compared to, will be "Hydrangeas flower summer", i.e. "Title Keyword Keyword".
TheĀ assetĀ has aĀ description of "pretty flower", so if you were to add aĀ Description free text filter,Ā the string, which the parameter is compared to, will be "Hydrangeas flower summer pretty flower", i.e. "Title Keyword Keyword Description".
The "comparison" is aĀ Contains function, i.e. the filter will return any assets, whose "free text string" containsĀ the parameter, e.g. a parameter of "flower" will return theĀ asset. The parameter "flo" will return the asset as well, as parts of strings are also searchable.Ā
Due to the inner workings of how suchĀ filters work, anyĀ search, which has aĀ freetext filter,Ā MUST be populated (see UseSolr for a guide on how to populate a search).
3.2 Equals
Tests whether a Filter's parameter matches exactly with the data, theĀ filterĀ works on.
Example:
ThisĀ filter filters out any results, whose item ID does not match a supplied ID.
Accepts aĀ singleĀ parameter.
3.3 EqualsWithZeroAsNull
ThisĀ Comparison type is useful when filtering assetsĀ based on a boolean value, which might not have been initialised. The way something will skip initialisation, is by not editing the metadata field. Only when edited (and saved) it will contain a "0" or a "1", until then, it will be "null".
The filtering logic checks whether the suppliedĀ parameter equals the data theĀ filter works on, OR the supplied parameter is 0 AND the data is null.
Accepts aĀ singleĀ parameter.Ā
3.4 EqualsOrNull
The same as withĀ Equals except that resultsĀ with a "null"Ā value are not filtered out.
ThisĀ Comparison typeĀ is useful when filteringĀ assetsĀ based on a value, which might not have been initialised, e.g. the data "item.LastPublished" is a datetime data type, which might be null.
In short this means that if you have title set as EqualsOrNull, and search for e.g. "pretty flower", the search will return all assets that contain "pretty flower" and all assets with an uninitialised title.
Accepts aĀ singleĀ parameter.
3.5 AllInList
Filters out any items with data, which does not exactly match all the supplied parameters.
Example:
ThisĀ filter will filter out any items, whoseĀ keywords does not contain the supplied keywords, i.e. if anĀ asset has theĀ keywordsĀ "pink", "fluffy", "Sith", and "Lord" and a user inputs "pink" and "kitten", then the "pink fluffy Sith lord" asset will be filtered out. If the userĀ inputs "pink" and "fluffy" then the Sith lord will be returned.Ā Ā
Accepts 1-many parameters.
3.6 InList
Filters out any items with data, which does not exactly matchĀ anyĀ of the supplied parameters.
Example:
Using this filter,Ā if a user inputs "pink" and "kitten", then in this case, the "pink fluffy sith lord" willĀ not be filtered out because one of the asset's keywords is "pink".
AcceptsĀ 1-manyĀ parameters.
3.7 NotInList
Filters out any results, which matches any of the supplied parameters.Ā
Example:
If aĀ user inputsĀ "pink" and "kitten" then the "pink fluffy sith lord" asset will be filtered out, because one of itsĀ keywords is "pink".
AcceptsĀ 1-manyĀ parameters.
3.8 Like
Works almost exactly like the SQL "like" operator.Ā
ExampleĀ filter:
If theĀ user inputs a parameter with value "key", the final SQLĀ like statementĀ is "like "%key%", i.e. any meta fields, which does not have a name containing the word "key", are filtered out.
AĀ Like filter isĀ very expensive, so be wary using thisĀ Comparison Type, as it may result in very slow searches.
3.9 Between
"Between" is a veryĀ specific Comparison Type: it MUSTĀ onlyĀ be used with filters,Ā which does work on dates or DateTimes, e.g. "asset.start_date" and "asset.end_date".
If a similar functionality is needed, but in the context of data other thanĀ dates orĀ DateTimes, e.g. filtering out results whose IDs areĀ betweenĀ 5 and 11, that functionality MUST be mimicked by creating two filters. An example of such two filters can be two filtersĀ with respectiveĀ Comparison Types ofĀ GreaterThan with a parameter value of 5 andĀ LessThan, with a parameter value of 11:
3.10 GreaterThan
Filters out any results whoseĀ dataĀ is not greater than the supplied parameter, i.e. it works exactly like the ">" operator.
3.11 LessThan
Filters out any results whoseĀ dataĀ is not less than the supplied parameter, i.e. it works exactly like the "<" operator.
3.12 EqualsOrGreaterThan
Filters out any results whoseĀ dataĀ is not equal to or greater than the supplied parameter, i.e. it works exactly like the ">=" operator.
3.13 EqualsOrLessThan
Filters out any results whoseĀ dataĀ is not equal to or less than the supplied parameter, i.e. it works exactly like the "<=" operator.
3.14 RecursiveLayoutfolder
Works exclusively with folders located in the table layoutfolders. As such, thisĀ Comparison Type will NOT work with other data.
Filters out assets, which do not belong to a folderĀ with the supplied layout folder ID parameter.
3.15 RecursiveDamcatalogfolder
Works exactly likeĀ RecusiveLayoutfolder, except that it looks at the folders defined inĀ damcatalog_folder.
3.16 IsDescendantOf
Works exclusively with data, which is an SQL hierarchy ID. Filters out any results which are not descendants.
3.17 Empty
Filters out results, whose data is notĀ null or an empty string.Ā
3.18 NotEmpty
Filters out results, whose data is null or an empty string.
3.19 EmptyCheckField
The same asĀ Empty, except that thisĀ filter will not be applied, if theĀ userĀ does not supply a parameter.
3.20 NotEmptyCheckField
The same asĀ NotEmpty, except that thisĀ filterĀ will not be applied, if theĀ userĀ does not supply a parameter.
Table of contents: