...
Code Block | ||
---|---|---|
| ||
{ "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" } }, { "type": "ENTITY", "props": { "field": "authorTokens", "suggester": "suggestAuthors", "dictionary": "suggesterEntityAuthors", "asFacet": false, "maxSuggestion": 5, "title": "Entities suggested", "subtitle": "Queries extending your current query terms" } } ] }, "hotkeysqueryParams": { "activeSearchBarfields": {[ "cmd":title", "shifturl", "key":id", "Sextension", "enable": falsepreview_content", }"last_modified", "deactiveSearchBar": {crawl_date", "cmd": "escapeauthor", "original_file_size", "enableemptied":, false } "repo_source" }, "devMode":] { }, "enablehotkeys": false,{ "banneractiveSearchBar": { "locationcmd": "BOTTOMshift", "contentkey": "S"Dev, mode banner content" "enable": false }, "propsdeactiveSearchBar": { "backgroundColorcmd": "orangeescape", } "enable": false } } } |
The “left” key corresponds to what is displayed in the left column of the interface.
...
,
"devMode": {
"enable": false,
"banner": {
"location": "BOTTOM",
"content": "Dev mode banner content",
"props": {
"backgroundColor": "orange"
}
}
}
} |
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#Search-Tabs.
The “right” key corresponds to what is displayed in the right column of the interface.
...
In the configuration below, we have 3 suggesters : 1 of type basic and 2 of type entity. The difference between the 2 entities suggesters here, is at the field and titles parameters level, but it could also be at the subtitle level.
Code Block | |||||
---|---|---|---|---|---|
| ...
"searchBar": {
| ||||
... "searchBar": { "suggesters": [ { "type": "BASIC", "props": { "maxSuggestion": 5, "title": "SUGGESTED QUERIES", "subtitle": "Queries extending your current query terms", }, }, { "type": "ENTITY", "props": { "suggestersfield": [ "authorTokens", "suggester": "suggestAuthors", { "typedictionary": "BASICsuggesterEntityAuthors", "propsasFacet": {false, "maxSuggestion": 5, "title": "SUGGESTEDEntities QUERIESsuggested", "subtitle": "Queries extending your current query terms", }, }, { "type": "ENTITY", "props": { "field": "authorTokensauthorSocialSecurityNumber", "suggester": "suggestAuthors", "dictionary": "suggesterEntityAuthors", "asFacet": false, "maxSuggestion": 5, "title": "Entities suggested by social security number", "subtitle": "Queries extending your current query terms" } }, { "type": "ENTITY", } "props": { } ] "field": "authorSocialSecurityNumber", "suggester": "suggestAuthors", } ... |
Adding a new type of suggester
This requires developing new components in DatafariUI. Refer to the DatafariUI read me for more information on how to do that.
Define the list of preffered sources
You can define a list of preffered sources by adding a “sources” key to the ui-config object that holds an array of soruce names, ordered in decreasing order of their importance.
Code Block |
---|
{
...
"sources": ["source name 1", "source name 2"]
} |
If absent or empty, this has no effect. When present, results coming from the preffered sources are boosted and appear higher in the search results.
Warning |
---|
This feature is not active yet (as of april 2022). You can define you preferences, but no boosting will occur. |
QueryParams
From ui-config.json
file, you can customize the fields you send to Solr. queryParams
is an object which can have the following keys :
Key name | description | Default value | |||||
---|---|---|---|---|---|---|---|
fields | An array of string that define fields sent to solr for each query. |
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
Adding a new type of suggester
This requires developing new components in DatafariUI. Refer to the DatafariUI read me for more information on how to do that.
Define the list of preffered sources
You can define a list of preffered sources by adding a “sources” key to the ui-config object that holds an array of soruce names, ordered in decreasing order of their importance.
Code Block |
---|
{
...
"sources": ["source name 1", "source name 2"]
} |
If absent or empty, this has no effect. When present, results coming from the preffered sources are boosted and appear higher in the search results.
...
|
useHotkey hook
This hook allows to define a hotkey with one command key plus an optional second letter key.
Command keys are defined as below (case sensitive) :
...