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 Filter tab

    • This type of tab allows users to search for nodes with simple condition builder and fulltext search. Any property or node labels (_dbLabels) can be displayed as columns in the result table. The user can define a simple condition to filter nodes and combine it with fulltext search to find specific nodes to start the visualization with.

    • Tab definition consists of "title", "description", "columns", and "condition" (optional) - see Explanation of JSON properties below.

  • Cypher tab

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

    • Tab definition consists of "title", "description", and "cypher" - see Explanation of JSON properties below.

Configuration

  1. In the "Application menu" (top right) choose page "Settings"

  2. In the "Application Settings" panel click on the "SEARCH_TABS" row.

  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 a good starting point to create your own configuration.

  1. Main menu (top right) - Page Settings

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

  3. Press button "Automatic", wait for the generator to generate JSON and store by pressing button "Save".

Description of configuration

The 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 the fulltext index configuration here - Graph Connections#FulltextSearchConfiguration.

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

Example of a Cypher Query Template configuration:

{
"title":"Example Pattern",
"description":"This pattern looks for all relationships of a particular types starting in nodes with some specific labels. Max number of returned elements is 100.",
"template":{
"textTemplate" : "Get all nodes with labels (all labels are mandatory) $labels related to other nodes through relationships of types $rel_types. Max number of returned elements is 100",
"cypherTemplate" : "MATCH (a$labels)-[r]->(b) WHERE type(r) IN $rel_types RETURN a, r, b LIMIT 100",
"parameters" : [
{
"parameter" : "labels",
"type" : "NODE_LABELS",
"config" : {
"multiple" : true,
"property" : "type",
"cypherColonFormat" : true
}
},
{
"parameter" : "rel_types",
"type" : "REL_TYPES",
"config" : {
"multiple" : true
}
}
]
}
}

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)

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

      • parameter - identification used in cypherTemplate

      • type - the type of input field. Based on this type a specific renderer (e.g. string input, number input, node searcher, ...) will be used on the Search page. All values (NODE_FULLTEXT_SEARCH, NODE_LABELS, ...) and their configs are in the table below.

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

Dynamic Parameter types and their configuration options

Param Type

Notes

Config

NODE_FULLTEXT_SEARCH

Returns node's ID (internal database ID) or a list of ID's. It's using a fulltext index for searching for the nodes. The fulltext search configuration like min length and throttle delay from the Graph Connections is used.

  • "placeholder": text shown in an empty input.

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

  • "resultProperties": list of properties that will be used in the result set to identify nodes.

  • "selectionProperties": list of properties that will be used in the selection set to identify nodes.

  • "exactMatch": boolean value whether the fulltext search should perform an exact match (a faster option) or non-exact match (a slower option but it's returning results matching the search pattern anywhere in the indexed properties).

  • "filter": an object containing "labels" and "properties" that will filter the nodes in the result set. The node in the result set has to have at least one of the listed labels and at least one of the listed values in the properties defined in the filter.

Example
{
"parameter" : "param_id",
"type" : "NODE_FULLTEXT_SEARCH",
"config" : {
"placeholder" : "search for nodes",
"multiple" : true,
"resultProperties" : ["Name", "Address", "Phone"],
"selectionProperties" : ["Name"],
"exactMatch" : true,
"filter" : {
"labels" : ["Person", "Company"],
"properties" : [
{
"property" : "State",
"values" : ["UK", "USA"]
}
]
}
}
}

NODE_PROPERTY_VALUES

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

  • "placeholder": text shown in an empty input

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

  • "defaultValues": default selected values

Example
{
"parameter" : "param_id",
"type" : "NODE_PROPERTY_VALUES",
"config" : {
"placeholder" : "select a property value",
"multiple" : false,
"labels" : ["some_label", "some_other_label"],
"property" : "property_key"
}
}

REL_PROPERTY_VALUES

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

  • "placeholder": text shown in an empty input

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

  • "defaultValues": default selected values

Example
{
"parameter" : "param_id",
"type" : "REL_PROPERTY_VALUES",
"config" : {
"placeholder" : "select a property value",
"multiple" : false,
"relTypes" : ["some_rel_type"],
"property" : "property_key"
}
}

NODE_LABELS

Returns node's label or a list of labels.

  • "placeholder": text shown in an empty input

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

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

Example
{
"parameter" : "param_id",
"type" : "NODE_LABELS",
"config" : {
"placeholder" : "select a node label",
"multiple" : false
}
}

REL_TYPES

Returns rel's type or a list of types.

  • "placeholder": text shown in an empty input

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

  • "defaultValues": default selected values

  • "cypherColonFormat": true/false

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

    • Note: do not use this format together with "multiple":true, because Cypher does not support multiple relationship types in the MATCH part of the query (because relationships can have only one type).

Example
{
"parameter" : "param_id",
"type" : "REL_TYPES",
"config" : {
"placeholder" : "select a relationship type",
"multiple" : false
}
}

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

Example
{
"parameter" : "param_id",
"type" : "STRING",
"config" : {
"placeholder" : "select a value",
"multiple" : false,
"values" : ["value_1", "value_2", "value_3"]
}
}

NUMBER

Simple input for any number values and arrays of numbers.

  • "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
{
"parameter" : "param_id",
"type" : "NUMBER",
"config" : {
"placeholder" : "select a value",
"multiple" : false,
"values" : [1, 2, 3, 4, 5]
}
}

CYPHER

Select with values loaded with a cypher query.

  • "placeholder": text shown in an empty input

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

  • "query": cypher query for loading the values in suggestions.

  • "defaultValues": default selected values

Example
{
"parameter" : "param_id",
"type" : "CYPHER",
"config" : {
"placeholder" : "select a value",
"multiple" : false,
"query" : "MATCH (n:some_label) RETURN DISTINCT n.property LIMIT 20
}
}