Search tabs

Required Permission: Settings management (Read more about Permissions)

Table of Contents

The Search tabs setting is used as a default setting of tabs in search page at user's first login. There are two types of search tabs that can be defined with this setting:

  • Node's table tab

    • this type of tab lets the user to choose properties that will be displayed as table columns and the user can define simple condition to filter nodes and combine it with fulltext search to find specific nodes to start the visualization with

    • tab is defined with "title", "columns" and "condition" (optional) - see Explanation of JSON properties below

  • Cypher tab

    • this type of tab lets the user to enter any cypher query (based on user's permissions only read cypher queries can be executed or any cypher query if the user has Read all data permission)

    • tab is defined with "title" and "cypher" - see Explanation of JSON properties below

Configuration

  1. Main menu (top right) - Page 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. Main menu (top right) - Page 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. Main menu (top right) - Page 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 in JSON format. Example:

[
{
"title":"Nodes in a table",
"description":"Persons and Companies of some subtype",
"condition":{
"labels":[ "Person", "Company" ],
"properties":[
{
"property":"type",
"values":[ "person", "company" ]
},
{
"property":"subtype",
"values":[ "auditor", "manager", "limited" ]
}
]
},
"columns":[
{
"property":"title"
},
{
"property":"type"
}
]
},
{
"title":"Cypher query",
"description":"Returns the first 100 nodes.",
"cypher":"MATCH (n) RETURN n LIMIT 100"
},
{
"title":"SomeRelType Pattern",
"description":"This pattern looks for all relationships of a particular type starting in nodes of some specific type. Max number of returned relationships is 100.",
"template":{
"textTemplate" : "Get all nodes related to nodes of type $type_list with relationship type $rel_type . Max number of returned nodes is 100",
"cypherTemplate" : "MATCH (a:SomeLabel)-[r:$rel_type]->(b) WHERE a.type IN $type_list RETURN r LIMIT 100",
"parameters" : [
{
"parameter" : "type_list",
"type" : "NODE_PROPERTY_VALUES",
"config" : {
"multiple" : true,
"labels" : ["SomeLabel"],
"property" : "type"
}
},
{
"parameter" : "rel_type",
"type" : "REL_TYPES",
"config" : {
"multiple" : false
}
}
]
}
}
]

Explanation of JSON properties:

Property

Values

Default

Description

title

MANDATORY

String

Title of tab with search results used on Search page.

description

String

Description of the Search tab. It's shown on the Search page and the user can change it (the change is visible only to the user).

cypher

String

Cypher query that defines the output of this search tab

template

Object

Cypher query Template object.

template.textTemplate

String

The textual representation of the Cypher template query with dynamic parameters in the text (e.g. $type_list). Example: "Get all nodes related to nodes of type $type_list with relationship type $rel_type . Max number of returned nodes is 100."

template.cypherTemplate

String

The cypher representation of the Cypher template query with dynamic parameters in the text (e.g. $type_list). Example: "MATCH (a:SomeLabel)-[r:$rel_type]->(b) WHERE a.type IN $type_list RETURN r LIMIT 100"

template.parameters

Array of PDOs

An array of Parameter Definition Objects (PDOs). PDOs can more precisely define the input restrictions and options for every dynamic parameter of the Cypher template query. It's not mandatory to define every dynamic parameter but it gives much more value for the user, like auto-suggestions and more.

PDO.parameter

String

Name of the dynamic parameter. Example: "type_list"

PDO.type

String

Type of the dynamic parameter. Available types are listed in the chapter below ("Cypher Query Template Configuration")

PDO.config

Object

Configuration of the dynamic parameter. This object is different for every PDO.type value. Please see the chapter below ("Cypher Query Template Configuration") for more information and examples.

condition

Object

Condition for filtering nodes or relationships listed in tab. Always use together with columns

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

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.

SFO.values

MANDATORY

Array of strings/numbers/booleans

List of values of the DB property which are matched in search filter. The exact string/number/boolean value is matched.

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

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

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.

Cypher Query Template Configuration

The configuration of the template consists of these parts:

  • title - Tab title displayed on the Search page

  • description (optional) - Description of the pattern displayed on the Search page. This is a good place to explain to the user what the pattern is for, if it's a complicated one.

  • template - actual template configuration

    • textTemplate - The text that is shown to the user with dynamic parameters (prefixed with "$") that the user can change

    • cypherTemplate - Cypher query with dynamic parameters prefixed with $ (e.g. $param1, $date, ...). These dynamic fields will be replaced in runtime with user inputs (like node IDs or some filtering values)

    • params - config for every dynamic param used in the cypherTemplate and textTemplate

      • param - identification used in cypherTemplate

      • type - the type of input field. Based on this type a specific renderer will be used on Search page (e.g. string input, number input, node searcher, ...)

      • config - configuration for the specific param field (determined by the "type" attribute)

Dynamic Parameter types and their configuration options

Param Type

Notes

Config

NODE_PROPERTY_VALUES

Returns node's prop value or a list of prop values.

  • "multiple": boolean value whether the num of selected values can be more than 1.

  • "labels": list of node labels for which the property values should be returned.

  • "property": key of the property that should be returned.

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

REL_PROPERTY_VALUES

Returns rel's prop value or a list of prop values.

  • "multiple": boolean value whether the num of selected values can be more than 1.

  • "relTypes": list of rel types for which the property values should be returned.

  • "property": key of the property that should be returned.

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

NODE_LABELS

Returns node's label or a list of labels.

  • "multiple": boolean value whether the num of selected values can be more than 1.

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

  • "cypherColonFormat": true/false

    • if true then the resulting value is returned in the cypher colon format, e.g. ":LABEL_1:LABEL_2", that can be used in the MATCH part of cypher queries

REL_TYPES

Returns rel's type or a list of types.

  • "multiple": boolean value whether the num of selected values can be more than 1.

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

STRING

Simple input for any string values and arrays of strings.

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

  • "values": defined list of values in the suggestion list

  • "strict": true/false

    • if true then only values defined in "values" can be entered by the user

NUMBER

  • "placeholder": text shown in an empty input

  • "defaultValues": default selected values

  • "values": defined list of values in the suggestion list

  • "strict": true/false

    • if true then only values defined in "values" can be entered by the user

Example of a Cypher Query Template configuration:

{
"title":"SomeRelType Pattern",
"description":"This pattern looks for all relationships of a particular type starting in nodes of some specific type. Max number of returned relationships is 100.",
"template":{
"textTemplate" : "Get all nodes related to nodes of type $type_list with relationship type $rel_type . Max number of returned nodes is 100",
"cypherTemplate" : "MATCH (a:SomeLabel)-[r:$rel_type]->(b) WHERE a.type IN $type_list RETURN r LIMIT 100",
"parameters" : [
{
"parameter" : "type_list",
"type" : "NODE_PROPERTY_VALUES",
"config" : {
"multiple" : true,
"labels" : ["SomeLabel"],
"property" : "type"
}
},
{
"parameter" : "rel_type",
"type" : "REL_TYPES",
"config" : {
"multiple" : false
}
}
]
}
}