Customizing DatafariUI - Results List

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:

image-20250522-083958.png

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 present

    • url : Displays the url for each result if present

    • logo: Displays the file type logo for each result if present

    • previewButton: Displays the preview button for each result if present

    • extract: Displays the text snippet with highlighting for each result if present

    • askAI: 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 attribute target. 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 attribute target.

  • titleTarget: (optional, default _self): target to open the document. Values are the same as the HTML attribute target.

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:" ] } }

This formatting will be applied to all Links related to a document, i.e. folder and file links.


Valid from Datafari 5.1 (UI 1.0.0-beta-0.6.0) up to v6.2

Shows the list of results.

Looks like this:

The definition looks like this, in ui-config.json

{ "type": "ResultsList", "data": ["title", "url", "logo", "previewButton", "extract"], "folderLinkSources": [], "folderTarget": "_blank", "previewTarget": "_self" }

Parameters:

  • data: An array of data to be displayed. Possible values:

    • title: Displays the document title for each result if present

    • url : Displays the url for each result if present

    • logo: Displays the file type logo for each result if present

    • previewButton: Displays the preview button for each result if present

    • extract: Displays the text snippet with highlighting for each result if present

  • 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 attribute target. The values you can declare mandatorily 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 attribute target.

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):