Searchable Types
Supported <Searchable>
types are:
Words
RangeOfDates
RangeOfMillis
String
CaseInsensitiveString
OrgPath
Flags
Padding
InList
Types automatically take user allow
permissions into account when executing a search.
The permission set format is as follows:
transactions=allow("ViewName"('Searchable.Name'='Value'))
By repeating the same Searchable.Name with different values in the permission set syntax you are supplying a list of possible values:
transactions=allow("ViewName"('Searchable.Name1'='Value1', 'Searchable.Name1'='Value2', 'Searchable.Name1'='Value3'))
Warning
Not all searchable types support multiple values derived from a users permission sets
The following <Searchable>
types support multiple values obtained from user permissions:
Words
String
CaseInsensitiveString
These types construct a search term for each repeating value obtained from the users permissions.
When multiple terms exist the logical OR
operator is applied to the repeated terms in the search
Note
The logical AND
operator can be added to a transaction search by adding additional <Searchable>
elements with the same <Xpath>
User Email Auto Expansion¶
Permission sets can specify the following as a value:
- %USER.EMAIL%
This value will be replaced by the current users email address as the search term is evaluated
Words¶
Evaluates XPATH CONTAINS. If multiple <XPath>
s are provided then the generated search terms are delimited by the logical OR
operator.
- (xpath CONTAINS ‘abc’ OR xpath CONTAINS ‘abc’)
When repeating permission set allow
terms are added you can end up with:
- (xpath CONTAINS ‘abc’ OR xpath CONTAINS ‘abc’) OR (xpath CONTAINS ‘def’ OR xpath CONTAINS ‘def’) OR (xpath CONTAINS ‘ghi’ OR xpath CONTAINS ‘ghi’)
assuming a user has permissions:transactions=allow("ViewName"('Searchable.Name1'='def', 'Searchable.Name1'='ghi'))
Advanced syntax¶
When performing searches using the UI you can apply advanced syntax to build complex queries.
Note
Full Text searches uses the english
as default language.
A query consists of single words separated by the operators & (AND), | (OR), ! (NOT), possibly grouped using parentheses
More information could be found on PostgreSQL Full Text Search
Examples
Database entries |
---|
fee |
foo |
bar |
fee foo |
fee bar |
foo bar |
fee foo bar |
feefoo |
feebar |
feefoobar |
amalto |
Query: fee
Description: Returns entries containing the word fee
Output: fee, fee foo, fee bar, fee foo bar
Query: foo fee
(same as foo & fee
)
Description: Returns entries containing the words foo
AND fee
.
Output: fee foo, fee foo bar
Query: "fee foo"
Description: Returns entries containing word fee
followed by the word foo
Output: fee foo, fee foo bar
Query: feef:*
or feef*
Description: Returns entries containing words starting with feef
followed by anything.
Output: feefoo, feefoobar
Query: b:* & fee
Description: Returns entries containing a word starting with b
AND the word fee
.
Output: fee bar, fee foo bar
Query: fee & !b:*
Description: Returns entries containing word fee
AND not containing a word starting with b
.
Output: fee, fee foo
Query: amalto | bar
Description: Returns entries containing word amalto
OR bar
.
Output: bar, fee bar, foo bar, fee foo bar, amalto
Query: (amalto | foo) & !bar
Description: Returns entries containing word amalto
OR foo
without word bar
.
Output: foo, fee foo, amalto
RangeOfDates¶
Values pairs are supplied in the search criteria using the names:
Searchable.Name
_fromSearchable.Name
_to
The format of the supplied values is specified as path of the type declaration:
<Type>RangeOfDates(yyyy'-'MM'-'dd' 'HH:mm:ss.S z)</Type>
If the given date value cannot be parsed or the given format is invalid, a default format may be used.
This default can be specified in a .conf file using key: p6.service.views.default.date.format
Values can be specified using a user allow
permissions however only the first value of a repeating value sequence will be used.
RangeOfMillis¶
Values pairs are supplied in the search criteria using the names:
Searchable.Name
_fromSearchable.Name
_to
The format of the supplied values is specified as the number of millis since the epoch.
Values can be specified using a user allow
permissions however only the first value of a repeating value sequence will be used.
String¶
Evaluates XPATH EQUALS. Multiple <Xpath>
elements are not supported.
Values can be specified using a user allow
permissions, repeating value sequence delimited with the OR
operator
CaseInsensitiveString¶
Evaluates XPATH IEQUALS. Multiple <Xpath>
elements are not supported.
Values can be specified using a user allow
permissions, repeating value sequence delimited with the OR
operator
OrgPath¶
Warning
Only a single <Searchable>
of type <OrgPath>
is allowed per view
The evaluation of this type originates entirely from a users allow
permission sets. The following syntax is expected:
transactions=allow("ViewName"(BRANCH | USER | UNIT))
The searching users associated position(s) in the instance organisational tree are evaluated as the search terms are built using either BRANCH, UNIT or USER tree hierarchy rules. The one or more organizational tree paths form part of a single comma separated value that is used to form the expression:
XPATH ARRAY_OVERLAP (have elements in common) with comma separated org value(s)
Values can be specified using a user allow
permissions however only the first value of a repeating value sequence will be used.
Organizational Tree Hierarchy Terms:
- USER: A list of all tree nodes the user is directly assigned to
- UNIT: As USER plus the paths of all other trees nodes with the same parent as the nodes to which the user is directly assigned.
- BRANCH: As USER plus the paths of all child decedent nodes to nodes which the user is directly assigned
Flags¶
The search criteria single value is a JSON string containing flag names and boolean match values (true|false) The JSON is parsed and an expression is created as follows:
XPATH CONTAINS ( Flag.Name1 & Flag.Name2 & !Flag.Name3 )
Values can be specified using a user allow
permissions however only the first value of a repeating value sequence will be used.
Padding¶
Has no effect on search term generation. Only used as a spacing mechanism on the user interface.
InList¶
Evaluates XPATH[.=value]
EXISTS. Multiple <Xpath>
elements are not supported.
Values can be specified using a user allow
permissions however only the first value of a repeating value sequence will be used.