Customizing DatafariUI - Results List
Valid from Datafari 6.2 (UI v2 1.1.2)
See end of the page for older versions
This part is related to the list of results.
Looks like this:
The definition looks like this, in ui-config.json
(Complete configuration file):
"center": {
"main": [
...
{
"type": "ResultsList",
"data": ["title", "url", "logo", "previewButton", "extract", "askAI"],
"maxTitleSize": 50,
"maxExtractSize": 200,
"folderLinkSources": [
"enron"
],
"folderTarget": "_blank",
"previewTarget": "_self",
"titleTarget": "_self"
}
]
}
Parameters:
data
: An array of data to be displayed. Possible values:title
: Displays the document title for each result if presenturl
: Displays the url for each result if presentlogo
: Displays the file type logo for each result if presentpreviewButton
: Displays the preview button for each result if presentextract
: Displays the text snippet with highlighting for each result if presentaskAI
: Displays the “Ask with AI“ button if present. This button lets you use the Datafari chatbot to focus your questions solely on the selected document.
maxTitleSize
: This is the number of characters beyond which the title will be presented in its truncated form. For example: “France Labs Enterprise Se...fari, ManifoldCF | Page 2” replace “France Labs Enterprise Search Blog | blog on Enterprise Search, Solr, Datafari, ManifoldCF | Page 2".maxExtractSize
: This is the number of characters beyond which the snippet will be presented in its truncated form. The snippet ends with “…”.folderLinkSource
(default is an empty array[]
in which case nothing will be displayed) : array of sources to open as a folder. Needs to match with sources declared (case sensitive). For instance, if you have a source named “Enron”, the array should be["Enron"]
folderTarget
(optional, default is_blank
): target to open folder. Values are the same as the HTML attributetarget
. The values you can declare mandatory come from the repo_source solr field, displayed via the source facet field to users.previewTarget
(optional, default_self
): target to open preview page. Values are the same as the HTML attributetarget
.titleTarget
: (optional, default_self
): target to open the document. Values are the same as the HTML attributetarget
.
Any data not present is not displayed. If the data parameter is absent or is not an array, the default (showing everything) is used. Values other than the one given above are ignored. An empty array results in the following (Yes this is useless but possible):
fileOpenPrefix
A second set of parameters are available to specify if the title and the folder of the document point to the original link or to the redirection of Datafari API. This means that the redirection performed by the Datafari API will no longer be performed. This redirection is used to count the number of clicks on a document in order to feed Datafari statistics.
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.
Here is the detailed configuration available:
"fileOpenPrefix": {
"prefix": "file",
"clickOrgUrl": {
"active": false,
"forAll": false,
"forPrefixURLs": [
"file:"
]
}
}
clickOrgUrl
: config to keep the original url of the document. If this parameter is activated, the URL "http://localhost/Datafari/rest/v2.0/url?url=file://my/directory/myFile.txt" will be modified to: "file://my/directory/myFile.txt"active
: activate the "keep original url" processing.forAll
: if true, no matter the value of the parameterforPrefixURLs
, the original url will be applied to all documentsforPrefixURLs
: will be applied to a list of prefix specified here.
prefix
: in a file path like this: "file://my/directory/myFile.txt" the "file:" prefix will be replaced by the value specified in this parameter. In the example above, the url will be replaced by "datafari://my/directory/myFile.txt". This prefix will be applied in any url to click, for example: "http://localhost/Datafari/rest/v2.0/url?url=file://my/directory/myFile.txt" => "http://localhost/Datafari/rest/v2.0/url?url=datafari://my/directory/myFile.txt"
This formatting will be applied to all Links related to a document, i.e. folder and file links.