Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Data Loader uses config files for facet creation, which has an HJson format (which is a more human friendly superset of Json). In the following chapters you can find the description of the attributes used in these files and some examples.

...

Facets config file

Sample file

Below is an example of a fully valid Hjson file which is not a valid Json. Notice how some of the keys/values are missing quotes and some rows are missing commas a the the end. 

Code Block
languagejs
{ 
	"InteractionSubject": {
		"name": "Interaction Subject",
		"display_name": Subject,
		"group_name": Interactions,
		"visible": true,
		"searchable":true,
        "typeahead":true
	},
	"InteractionType": {
		"name": "Type of Interaction ",
		"display_name": "Type",
		"group_name": "Interactions",
		visible: true,
		searchable:true,
        typeahead:false
	},
	"Date": {
		"name": "Date of creation",
		"data_type": "datetime",
		"input_format_string": "%Y-%m-%dT%H:%M:%S",
		default_value:"1900/01/01"
		"visible": true
	},
	"EntittledUsers": {
        "name": "Users",
        "auth": true
        "auth_value_mandatory": true,
        import: false
    },
    "InternalAttendees": {
        "name": "Attendees",
        "group_name": "Interactions"
        "pivotal_group": "Members",
        "delimiter": ";"
        "visible": true
    },
	NoAtendees: {
		name: "Number of Atendees",
		"data_type": "int",
		"visible": true
		"searchable":false
	},
}

...

Note
iconfalse
titleCharacter Encoding and Facet Keys

Be careful using characters outside of the printable ASCII encoding range, such as umlauts (ü) or diacritics (é) in the facet key above. JSON files are normally encoded as UTF-8 while Excel, for example, will default to using ANSI encoding such as Windows-1252. That means if you use a value such as "Zürich" in a facet key in your JSON, it will only match the corresponding column in the input data if that data is also encoded as UTF-8. Recent versions of Excel 2016 can now export data to "CVS UTF-8" but if in doubt, simple restrict column names to characters in the printable ASCII range (i.e. avoid umlauts).


Facet Attributes Reference

...

KeyData TypeDescription
analyzedBooleanOnly applies to data_type string. Defaults to True. If set to False the field is not analyzed for searching. It can be used only for display and filtering & aggregation. This speeds up index operations and keeps the index size smaller.

auth

Boolean

If set to 'true' for a field, this field will be used to determine user access to the Squirro item. Default 'false'.

auth_value_mandatory

Boolean

If value of the filed in the data source is empty, the item will not be uploaded.

data_type

String

Data type of the facet. One of ('string', 'int', 'float', 'datetime'). The default is 'string'.

default_value

String

Default value of the facet if value is None.

delimiter

String

Specified for columns that have multiple values, i.e. pivotal and auth columns.

display_name

String

Name to show to the user in the front-end. Maximum 50 characters

format_instr

String

Formatting instruction for the facet value display. This parameter defines how the Squirro UI will display the value. This is only relevant for int, float and dates. It’s also documented here.

group_name

String

Label of the group this facet is under. Maximum 50 characters.

import

Boolean

For specifying if a column will be loaded as a facet or not. Default 'true'.

input_format_string

String or List of strings

Format of the date string coming from the source (used for csv and excel). When importing from database, the date values are of type datetime and don’t need a format. Only for datetime columns.

Can be specified as a list of format strings. The data loader then tries each format string in order and uses the first one that doesn't result in a parsing error.

name

String

Name use to display and access the facet in the Squirro UI - used to identify facets in the search field for example and on item tags. Maximum 50 characters

pivotal_group

String

If this attribute exists than the column is also a pivotal column. That means that the values of that column, delimited by 'delimiter', were joined from a detail table to generate only one line in the source. You can find more information here.

searchable

Boolean

If 'true' this facet values will be searchable. Default 'false'.

typeaheadBooleanIf 'true', this facet will be included in the typeahead search function of the various search fields. Default 'false'. Added with version 2.4.0 (Aspen)

visible

Boolean

If `false` this facet will be hidden in the front-end. Default 'true'.

...