Search tabs
Permission: Settings management
Search tabs setting is used to configure design of tabs in result at search page.
Configuration
-
Left menu - settings
-
In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".
-
Enter JSON configuration and confirm by pressing "Save" button.
Default configuration
Default configuration contains several default attributes to see how configuration should looks like. Probably this configuration doesn't match model of your data but can serve as example of short configuration.
-
Left menu - settings
-
In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".
-
Press button "Default" and store by pressing button "Save".
Automatic configuration
Automatic configuration is used to generate configuration which contains attributes of several random data nodes and several random relationships. Random nodes are selected as first 1000 nodes, random relationships are selected as first 1000 relationships. Generated JSON contains two tabs: one for nodes and all attributes of random nodes and second for relationships and all attributes of random relationships.
This automatically generated configuration can be used as good starting point to create own configuration.
-
Left menu - settings
-
In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".
-
Press button "Automatic", wait for generator to generate JSON and store by pressing button "Save".
Description of configuration
Configuration is entered as JSON. Example of JSON:
[
{
"title": "All Nodes",
"group": "nodes",
"columns": [
{"dataAttr": "_dbId"},
{"dataAttr": "title"}
]
},
{
"title": "Nodes with type person",
"group": "nodes",
"condition" : {
"properties": [
{"property": "type", "values": ["person"]}
]
},
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "Auditors and Managers",
"group": "nodes",
"condition" : {
"properties": [
{ "property": "type", "values": ["person"]},
{ "property": "subtype", "values": ["auditor", "manager"]}
]
},
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "Nodes with labels CompanyBig or CompanySmall",
"group": "nodes",
"condition" : {
"labels": ["CompanyBig", "CompanySmall"]
},
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "All Relationships",
"group": "edges",
"columns": [
{"property": "title"},
{"property": "source_title"},
{"property": "target_title"}
]
},
{
"title": "Relationships RELATED",
"group": "edges",
"condition" : {
"types": ["RELATED"]
},
"columns": [
{"property": "title"},
{"property": "source_title"},
{"property": "target_title"}
]
}
]
Explanation of JSON properties:
JSON property names used prior to version 1.12 are listed in parentheeses after the current name
Property |
Values |
Default |
Description |
Usage |
title (label) MANDATORY |
String |
|
Title of tab with search results used on Search page. |
Search Page |
group MANDATORY |
"nodes", "edges" |
|
Defines if this tab is for nodes or relationships search results. |
Search Page |
condition |
Object |
|
Condition for filtering nodes or relationships listed in tab. |
|
condition.properties (fields) |
null, undefined, Array of SFO objects |
|
Array of filter criteria. Defined criteria will be used in search and only elemets which match these criteria will be shown in results. If not defined, set to null or set to empty array then no filtering is applied for this tab. Each criteria is defined by SFO (Search Filter Object). Logical "AND" is between each criteria in properties and logical "OR" is between items in values. Final condition based on properties can be for example: "type"="person" AND ("subtype"="auditor" OR "subtype"="manager"). |
Search Page |
SFO.property (SFO.name) MANDATORY |
String |
|
Name of the DB property to filter on. This property has to be indexed, which means it has to be set in properties of Node Index configuration or Relationship Index configuration. See Node index or Relationship index. |
Search Page |
SFO.values MANDATORY |
Array of strings |
|
List of values of the DB property which are matched in search filter. The exact value is matched. |
Search Page |
condition.labels |
Array of strings |
|
Defines search criteria for node DB labels. Logical "OR" is between items. It's used only if group is set to "nodes". |
Search Page |
condition.types |
Array of strings |
|
Defines search criteria for relationship DB type. Logical "OR" is between items. It's used only if group is set to "edges". |
Search Page |
columns MANDATORY |
Array of CDO objects |
|
Array of column definitions used in search results table. Each column is defined by CDO (Column Definition Object) which holds primarily the DB property name. Other metadata is used from Data schema (e.g. title and orderType). |
Search Page |
CDO.property (CDO.dataAttr) MANDATORY |
String |
|
Name of the DB property used in defined column. Values of this DB property will be listed as cell values in table column. |
Search Page |
CDO.render EXPERIMENTAL |
String |
|
String used for creating a JavaScript function passed to DataTables as a column renderer. You can use this to create custom rendering of values in defined column. For example you can used the template labels to visually differentiate truthy and falsy values. The cell value is passed to function as data variable. Example: "switch(data){case 'truthy_value': return '<span class=\"label label-success\">'+data+'</span>'; break; case 'falsy_value': default: return '<span class=\"label label-danger\">'+data+'</span>';}" All label classes in template and their colors:
|
Search Page |