Defined searches¶
Defined searches can be configured to each node. These searches can be used to restrict the search space. By default, all attributes of all searches can be searched. FormFields can be defined in the search attributes and will not be sent to the server.
To search the child nodes in insight-mobile, a searches configuration must be set.
At e.g. selectFromTree can also use an explicit search.This definition also reduces the size of the offline search model in mobile.
Index search, one search field¶
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "assetnum",
"label": "Number",
"attributes": [
"ASSETNUM"
]
},
{
"name": "all",
"label": "All",
"attributes": [
"ASSETNUM",
"DESCRIPTION",
"SITEID"
]
}
]
},
Backend search, attribute search fields¶
Searches can be executed on the eam database tables.
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "assetnum",
"label": "Number",
"attributes": [
"ASSETNUM"
],
"backend": true
}
]
},
Index search, attribute search fields¶
Searches will be executed on search index using search fields for each attribute.
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "assetnum",
"label": "Number",
"attributes": [
"ASSETNUM"
],
"showFields": true
}
]
},
Override attribute properties¶
Attributes can be configured as complex objects to override existing attributes properties. Select attributes with options or selectFromTree.
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "assetnum",
"label": "Number",
"attributes": [
{
"name": "ASSETNUM",
"selectFromTree": null
},
{
"name": "COUNT",
"widget": "NativeDecimal"
}
],
"showFields": true
}
]
},
Disable multi value¶
Select attributes with options or selectFromTree have got a multi value support by default. This feature can be deactivated by "multiValue" = false. This must be done to use the autoFill feature.
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "assetnum",
"label": "Number",
"attributes": [
{
"name": "ASSETNUM",
"selectFromTree": {...},
"clientProperties": {
"multiValue": false
}
}
],
"showFields": true
}
]
},
Search operators¶
Attributes can be used with operators like: greater than, less than, like, equals, not equals. It is also possible to set two operators to archive a from to search. Then two input fields are generated, for example: ["gt", "lt"] Can only be used with "backend" or "showFields": true. Valid operators are:
- gt: greater than
- gte: greater than or equals
- lt: less than
- lte: less than or equals
- eq: equals
- notEquals: not equals
- like: like
"query": {
"constraint": "1 = 1",
"searches": [
{
"name": "reportdate",
"label": "Report date",
"attributes": [
{
"name": "REPORTDATE",
"search": {
"operators": [
"gte",
"lte"
]
}
}
],
"backend": true
}
]
},