Customizing DatafariUI - Configure suggester
Valid from Datafari 7.0 (UI v2 2.0.2)
See end of the page for older versions
This is done in the “ui-config.json” file. There is a searchBar field as shown below (Complete configuration file):
...
"searchBar": {
"suggesters": [
{
"type": "BASIC",
"props": {
"maxSuggestion": 5,
"title": "SUGGESTED QUERIES",
"subtitle": "Queries extending your current query terms",
},
"aggregator": false
},
{
"type": "ENTITY",
"props": {
"field": "author",
"suggester": "suggestAuthors",
"dictionary": "suggesterEntityAuthors",
"asFacet": false,
"maxSuggestion": 5,
"title": "Entities suggested",
"subtitle": "Queries extending your current query terms"
}
},
{
"type": "AUTOPROPOSALS",
"props": {
"maxSuggestion": 3
}
}
]
}
...This configuration is the default one, used in DatafariUI with 2 suggesters : basic and entity.
Below the parameters for each type of suggester are presented:
BASIC suggester
The basic suggester calls the default suggester bundled with datafari.
The definition looks like this:
{
"type": "BASIC",
"props": {
"maxSuggestion": 5,
"title": "SUGGESTED QUERIES",
"subtitle": "Queries extending your current query terms"
},
"aggregator": false
}
parameters:
maxSuggestion: The maximum number of suggestion that will be showed in the autocomplete for this suggester
title: the title of the autocomplete section for this suggester
subtitle: the subtitle / helper text of the autocomplete section for this suggester
aggregator : indicates if aggregator is activated or not. If yes use the Datafari REST API rest/v2.0/noaggregator/suggest instead of rest/v2.0/suggest
ENTITY suggester
A suggester designed for entity suggestions. Adds to the query a statement like: field:(“suggestion”).
The definition looks like this:
{
"type": "ENTITY",
"props": {
"field": "author",
"suggester": "suggestAuthors",
"dictionary": "suggesterEntityAuthors",
"asFacet": false,
"maxSuggestion": 5,
"title": "Entities suggested",
"subtitle": "Queries extending your current query terms"
}
}Parameters:
field: The field containing the entities. Please make sure that this field is present in the "uf" list in the /opt/datafari/solr/solrcloud/FileShare/conf/solrconfig.xml file: <str name="uf">exactContent exactTitle title_en… author…</str>. To perform this action, you need to have access to the server hosting Datafari and be able to modify this file. Search for the line specified and add your field if it is not present.
suggester: the solr request handler for that suggester
dictionary: the name of the dictionary used in the suggest handler
asFacet: weather the filter is added to the query body (q= parameter) or as an fq.
maxSuggestion: the maximum number of suggestions showed for this section of the autocomplete
title: the title of the autocomplete section for this suggester
subtitle: the subtitle / helper text of the autocomplete section for this suggester
This is where UI-side modifications appear, but you need to have prepared the backend beforehand to feed the suggester. See more here: https://datafari.atlassian.net/wiki/x/AYDZnw
AUTOPROPOSALS suggester
A suggester designed for document suggestions.
The definition looks like this:
{
"type": "AUTOPROPOSALS",
"props": {
"maxSuggestion": 3
}
}maxSuggestion: There is only one parameter to specify the maximum number of suggested documents.