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):
FieldFacet: https://datafari.atlassian.net/wiki/x/A4DB8
QueryFacet: https://datafari.atlassian.net/wiki/x/MoDD8
DateFacetCustom: https://datafari.atlassian.net/wiki/x/AwDP8
HierarchicalFacet: https://datafari.atlassian.net/wiki/x/GYDH8
SearchInformation: https://datafari.atlassian.net/wiki/x/HgDB8
ResultsList: https://datafari.atlassian.net/wiki/x/GADF8
RangeFacet: https://datafari.atlassian.net/wiki/x/TIDD8
AggregatorFacet: https://datafari.atlassian.net/wiki/x/DgDL8
… see the complete list of configurable elements in the “Table of content” of the main page https://datafari.atlassian.net/wiki/pages/resumedraft.action?draftId=2625634305 → “Displayed Facets and Elements” sub chapters.
“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