Search tabs

Permission: Settings management

Search tabs setting is used to configure filtering conditions of datasets displayed as tabs in search page.

Configuration

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".

  3. 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.

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".

  3. Press button "Default" and store by pressing button "Save".

Automatic configuration

Automatic configuration is used to generate configuration which contains attributes of several random nodes. Random nodes are selected as first 1000 nodes. Generated JSON contains tab for every existing label (max. 20) and one tab for all nodes.

This automatically generated configuration can be used as good starting point to create own configuration.

  1. Left menu - settings

  2. In panel "Settings list" use icon "Update" for setting "SEARCH_TABS".

  3. 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",
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "Nodes with type person",
"condition" : {
"properties": [
{"property": "type", "values": ["person"]}
  ]
},
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "Auditors and Managers",
"condition" : {
"properties": [
{ "property": "type", "values": ["person"]},
{ "property": "subtype", "values": ["auditor", "manager"]}
]
},
"columns": [
{"property": "_dbId"},
{"property": "title"}
]
},
{
"title": "Nodes with labels CompanyBig or CompanySmall",
"condition" : {
"labels": ["CompanyBig", "CompanySmall"]
},
 "columns": [
{"property": "_dbId"},
{"property": "title"}
]
}
]

Explanation of JSON properties:

Property

Values

Default

Description

Usage

title

MANDATORY

String

 

Title of tab with search results used on Search page.

Search Page

condition

Object

 

Condition for filtering nodes or relationships listed in tab.

 

condition.properties

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

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 fulltext 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).

Search Page

CDO.property

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:

  • label-default : gray

  • label-primary : blue

  • label-success : green

  • label-info : cyan

  • label-warning : yellow

  • label-danger : red

Search Page