Customizing DatafariUI - Configuration file

Customizing DatafariUI - Configuration file

Valid from Datafari 6.2 (UI v2 1.1.2)

See end of the page for older versions

It is possible to customize the facets displayed as well as some of the elements displayed in DatafariUI by modifying a configuration file. This configuration file is ui-config.json and is present in the public folder of the DatafariUI project.

When installed bundled with Datafari, the location of this file is:

/opt/datafari/www/ui-config.json

The default file looks like the following:

{ "search_type": "BM25", "left": [ { "type": "QueryFacet", "title": "Modification Date", ... }, { "type": "FieldFacet", "title": "Authors", "field": "author", ... }, { "type": "FieldFacet", "title": "Source", "field": "repo_source", ... }, ... ], "center": { "main": [ { "type": "NotConnectedUser", "displayNotConnectedUserWarning": true }, { "type": "SearchInformation", "data": [ "filters", "facets" ] }, { "type": "ResultsList", "data": [ "title", "url", ... ], ... } ], "tabs": [ { "type": "FieldFacet", "field": "extension", "max": 3 }, { "type": "FieldFacet", "field": "repo_source", "max": 3 }, ... ] }, "right": [ { "type": "DirectLinksWidget", "title": "Direct Links", "show": true, "visible": 1 }, { "type": "YellowPagesWidget", "title": "Yellow Pages", "show": true, "visible": 1 }, ... ], "searchBar": { "backdrop": true, "suggesters": [ { "type": "BASIC", "props": { "maxSuggestion": 5, "title": "SUGGESTED QUERIES", "subtitle": "Queries extending your current query terms" }, "aggregator": false }, { "type": "ENTITY", "props": { "field": "entity_person", "suggester": "suggestEntityAuthors", "dictionary": "suggesterEntityAuthors", "asFacet": false, "maxSuggestion": 5, "title": "Entities suggested", "subtitle": "Queries extending your current query terms" } }, ... ] }, "queryParams": { "fields": [ "title", "url", ... ] }, "mappingValues": { "pdf": "Fichier PDF", "doc": "Fichier Doc", "html": "Fichier Web" }, "exportResults": { "excel": { "minResults": 1, "maxResults": 5000, "defaultResults": 100 } }, "ssoForcedAuthentication": { "enable": true }, "displayFrontPage": { "enable": true }, "displayFrontPageTextCols": { "enable": true }, "devMode": { "enable": false, "banner": { "location": "BOTTOM", "content": "Dev mode banner content", "props": { "backgroundColor": "orange" } } }, "fileOpenPrefix": { "prefix": "file", "clickOrgUrl": { "active": false, "forAll": false, "forPrefixURLs": [ "file:" ] } } }

“search_type” key

This key prepares a new search performing. Only the BM25 search is available in production. Still, you can switch to vector search by entering the value “vector”. Hybrid search will be available later in 2025.

“left”, “center” and “right” keys

The left key corresponds to what is displayed in the left column of the interface.

The center key corresponds to what is displayed in the center (main) part of the interface. It contains two objects, a main object which may contain any component, and a tabs containing the declaration of tabs that are explained here: https://datafari.atlassian.net/wiki/x/J4DH8 .

The right key corresponds to what is displayed in the right column of the interface.

Each of these keys refer to an array of objects representing UI components.

Each object has a “type” property declaring the component to be instantiated as well as parameters for this component.

Supported components are (not exhaustive list):

“searchBar” key

It contains an object giving properties for the search bar and the suggesters to use in the “suggesters” array.

See the supported suggesters here: https://datafari.atlassian.net/wiki/x/NoDH8. How to configure them, here: https://datafari.atlassian.net/wiki/x/MIC98. And how to add a new one here: https://datafari.atlassian.net/wiki/x/KYDI8

“queryParams” key

To customize the fields you want in Solr response to a search query.

See more details in the related documentation: https://datafari.atlassian.net/wiki/x/LQDC8

“mappingValues” key

Is used to rename some values returned in facets. For example, you may want to rename the list of file extensions returned in your extension facet like this:

  • “pdf” => “PDF file”

  • “html” => “Web file”

  • “doc” => “Word file”

See more details in the related documentation: https://datafari.atlassian.net/wiki/x/MwDL8

“exportResults” key

Here you can add a new export format managed by the Datafari backend, if a new one is implemented. Currently only Excel is available.

See more details in the related documentation: https://datafari.atlassian.net/wiki/x/RADN8

“ssoForcedAuthentication" key

Allows you force the user to log in Datafari in order to use it, if this parameter is enabled. Otherwise, anonymous users can use Datafari.

Front page keys

This part concerns the keys ssoForcedAuthentication and displayFrontPage, which are used to control the Datafari home page.

See more details in the related documentation: https://datafari.atlassian.net/wiki/x/BIBB8Q

“devMode" key

To display a banner indicating that Datafari is in development mode and that some features are not yet fully operational.

See more details in the related documentation: https://datafari.atlassian.net/wiki/x/eAC_8

“fileOpenPrefix" key

Used to specify if the title and the folder links in the result list point to the original link or to the redirection of Datafari API. Activate direct access to document may be necessary, depending on the source you crawl. For example, to access files on Windows, it is necessary to use the original document link.

See more details in the related documentation: https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/4039442456/Customizing+DatafariUI+-+Results+List#CustomizingDatafariUI-ResultsList-fileOpenPrefix


Valid from Datafari 5.1 (UI 1.0.0-beta-0.6.0)

It is possible to customize the facets displayed as well as some of the elements displayed in DatafariUI by modifying a configuration file. This configuration file is ui-config.json and is present in the public folder of the DatafariUI project.

When installed bundled with Datafari, the location of this file is:

/opt/datafari/www/ui-config.json

The default file looks like the following:

{ "left": [ { "type": "FieldFacet", "title": "Extension", "field": "extension", "op": "OR", "minShow": 2, "maxShow": 5 }, { "type": "FieldFacet", "title": "Language", "field": "language", "op": "OR", "minShow": 2, "maxShow": 5 }, { "type": "FieldFacet", "title": "Source", "field": "repo_source", "op": "OR", "minShow": 2, "maxShow": 5, "show": false }, { "type": "QueryFacet", "title": "Creation Date", "queries": [ "creation_date:[NOW/DAY TO NOW]", "creation_date:[NOW/DAY-7DAY TO NOW/DAY]", "creation_date:[NOW/DAY-30DAY TO NOW/DAY-8DAY]", "creation_date:([1970-09-01T00:01:00Z TO NOW/DAY-31DAY] || [* TO 1970-08-31T23:59:59Z])", "creation_date:[1970-09-01T00:00:00Z TO 1970-09-01T00:00:00Z]" ], "labels": [ "Today", "From Yesterday Up To 7 days", "From 8 Days Up To 30 days", "Older than 31 days", "No date" ], "id": "date_facet", "minShow": 5, "children": [ { "type": "DateFacetCustom" } ] }, { "type": "HierarchicalFacet", "field": "urlHierarchy", "title": "hierarchical facet", "separator": "/" }, { "type": "AggregatorFacet", "title": "Aggregator facet" } ], "center": { "main": [ { "type": "SearchInformation", "data": ["filters", "facets"] }, { "type": "ResultsList", "data": ["title", "url", "logo", "previewButton", "extract"], "folderLinkSources": ["enron"], "folderTarget": "_blank", "previewTarget": "_self" } ], "tabs": [ { "type": "FieldFacet", "field": "repo_source", "max": 3 } ] }, "right": [], "searchBar": { "suggesters": [ { "type": "BASIC", "props": { "maxSuggestion": 5, "title": "SUGGESTED QUERIES", "subtitle": "Queries extending your current query terms" }, "aggregator": false }, { "type": "ENTITY", "props": { "field": "authorTokens", "suggester": "suggestAuthors", "dictionary": "suggesterEntityAuthors", "asFacet": false, "maxSuggestion": 5, "title": "Entities suggested", "subtitle": "Queries extending your current query terms" } } ] }, "queryParams": { "fields": [ "title", "url", "id", "extension", "preview_content", "last_modified", "crawl_date", "author", "original_file_size", "emptied", "repo_source" ] }, "hotkeys": { "activeSearchBar": { "cmd": "shift", "key": "S", "enable": false }, "deactiveSearchBar": { "cmd": "escape", "enable": false } }, "devMode": { "enable": false, "banner": { "location": "BOTTOM", "content": "Dev mode banner content", "props": { "backgroundColor": "orange" } } } }

“left”, “center” and “right” keys

The “left” key corresponds to what is displayed in the left column of the interface.

The “center” key corresponds to what is displayed in the center (main) part of the interface. It contains two objects, a “main” object which may contain any component, and a “tabs” containing the declaration of tabs that are explained here: https://datafari.atlassian.net/wiki/spaces/DATAFARI/pages/2625634305/Customizing+DatafariUI#CustomizingDatafariUI-Search-Tabs.

The “right” key corresponds to what is displayed in the right column of the interface.

Each of these keys refer to an array of objects representing UI components.

Each object has a “type” property declaring the component to be instantiated as well as parameters for this component.

Supported components are (not exhaustive list):

“searchBar” key

Then, there is the “searchBar” key, that contains an object giving properties for the search bar and the suggesters to use in the “suggesters” array.

Two types of suggesters are supported:

  • BASIC

  • ENTITY

"queryParams" key

To customize the fields you want in Solr response to a search query.

“hotkeys” key

Some customization of hotkeys is possible through “hotkeys” object.

“mappingValues” key

Is used to rename some values returned in facets. For example, you may want to rename the list of file extensions returned in your extension facet like this:

  • “pdf” => “PDF file”

  • “html” => “Web file”

  • “doc” => “Word file”

“exportResults” key

Here you can add a new export format managed by the Datafari backend, if a new one is implemented. Currently only Excel is available.

“devMode” key

To display a banner indicating that Datafari is in development mode and that some features are not yet fully operational.

 

See more details in the related documentations in the list of https://datafari.atlassian.net/wiki/pages/resumedraft.action?draftId=2625634305 document.