Advanced Search
An advanced search enables the search on specific attributes or a combination of attributes.
Behavior
In the UI click Advanced to display the Advanced Search dialog.
The advanced search dialog displays one or more field combinations of search property and search value.
![Advanced Search on One Criterion of type string](../../_images/advanced-search-1.png)
The advanced search supports searching on strings (enums, booleans), integers, dates, date-times and referenced types. See properties for more details on these field types.
For search properties of type date, the dialog offers a date picker.
image::advanced-search-2.png[Advanced Search on One Criterion of type date,align="left"
For search properties of type reference type the dialogue offers a dropdown list. In the image below the advanced search in the Persons UI will search for persons that are assigned to a specific provider.
The value for the specific provider can be picked from a dropdown list holding all providers. By keying in characters the dialogue restricts the list of providers to those that match the entered characters.
Through a pop-up box it is possible to specify the fields of the dropdown list that are searched for matching characters.
In the image below the list of providers is restricted by searching for matching characters in the name of the provider.
![Advanced Search on One Criterion of type reference type](../../_images/advanced-search-3.png)
In the image below the list of providers is restricted to those providers that have the characters '19' in their name.
![Advanced Search on One Criterion of type reference type - 2](../../_images/advanced-search-4.png)
To select a value from the list, click the entry.
![Advanced Search on One Criterion of type reference type - 3](../../_images/advanced-search-5.png)
Multiple Criteria
The dialog provides the option to add search criteria by using the Add Criterion button (the + sign) [1] and selecting the search property from the dropdown list.
In the image below the advanced search supports searching on a combination of person code and assigned provider.
![Advanced Search on Multiple Criteria](../../_images/advanced-search-multiple-criteria-1.png)
Multiple search criteria are combined using an AND statement. OR-search is implemented between the various values of a property when the same search property is added multiple times.
For example, it is possible to search for persons with Code like %99
AND (Assigned Provider=0018031423 OR Assigned Provider=0018031422).
![Advanced Search on Multiple Criteria](../../_images/advanced-search-multiple-criteria-2.png)
Searching
When a user selects the search criteria, enters search values for them and clicks the Search [2] button (the magnifier glass), the dialog closes and a search is performed based on all entered search values.
If a criterion is entered, but no value is given, then the criterion is not considered for the search.
The search is case-insensitive.
The default search operator is like for text attributes that allow wildcards like % and _.
The search operator is _equals_ for other types of attributes.
The selected criteria and entered search values are remembered until the user changes them, clicks the Reset link or signs out of the application (or the user session expires).
Closing the Dialogue
The dialog can be closed by clicking anywhere outside the dialog.
The selected criteria and entered search values are remembered until the user changes them, clicks the Reset link or signs out of the application (or the user session expires).
Floor Plan Payload
In the floor plan payload the advanced search component looks as follows:
"advancedSearch": { "criteriaMandatory":true|false, "properties": [ { "name":"name of the property" "sequence": 1, "queryOperator":"bet|gte|lt|like|likeic|eq|neq", "toUpperCase":"false|true }, { "name":" name of the property" "sequence": 2 "queryOperator":"bet|gte|lt|like|likeic|eq|neq" }, ... ] }
Specifying criteriaMandatory
as true restricts a user from performing a search with none of the criteria having a value.
When not specified system considers it to be false.
If advanced search specifies only one property in the payload, then instead of "Advanced" link, the property is directly displayed on the page. Selecting the value triggers the advanced search.
Personalization ensures that minimum one valid property (when a specified property does not exist, system ignores that property) is specified. |
Example
Consider the following example for configuring advanced search on the persons object:
"advancedSearch": { "criteriaMandatory": true, "properties": [ { "name": "code", "sequence": 1 }, { "name": "firstName", "sequence": 2 }, { "name": "name", "sequence": 3 }, { "name": "addressList", "sequence": 4, "properties": [ { "name": "postalCode", "sequence": 1, "label": "REL_PERSON_FIELD_ADDRESSLIST_POSTALCODE_DEFAULT" } ] }, { "name": "dateOfBirth", "sequence": 5 }, { "name": "assignedProviderList", "sequence": 6, "properties": [ { "name": "provider", "sequence": 1, "refType": { "type": "providers" } } ] }, { "name": "relationIdentifierList", "sequence": 7, "properties": [ { "name": "identifier", "sequence": 1, "toUpperCase": true, "queryOperator": "like", "label": "REL_RELATIONIDENTIFIER_FIELD_IDENTIFIER_DEFAULT" } ] } ] }
This displays an advanced search dialog with the following options:
UI Field | Search on Property | Input |
---|---|---|
Code |
person.code |
Free field |
First Name |
person.firstName |
Free field |
Last Name |
person.name |
Free field |
Postal Code |
person.addressList.postalCode |
Free field |
Date off Birth |
person.dateOfBirth |
Date picker |
Assigned Providers |
person.assignedProvidersList.code |
LOV on providers |
Identifier |
person.relation.relationIdentifier.identifier |
Free field |