diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/img/morelikethisconfig.png b/docs/manual/docs/administrator-guide/configuring-the-catalog/img/morelikethisconfig.png new file mode 100644 index 00000000000..bc215c549b5 Binary files /dev/null and b/docs/manual/docs/administrator-guide/configuring-the-catalog/img/morelikethisconfig.png differ diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/img/ui-settings-searchpage.png b/docs/manual/docs/administrator-guide/configuring-the-catalog/img/ui-settings-searchpage.png index 06bc3bff312..c764f5d9244 100644 Binary files a/docs/manual/docs/administrator-guide/configuring-the-catalog/img/ui-settings-searchpage.png and b/docs/manual/docs/administrator-guide/configuring-the-catalog/img/ui-settings-searchpage.png differ diff --git a/docs/manual/docs/administrator-guide/configuring-the-catalog/user-interface-configuration.md b/docs/manual/docs/administrator-guide/configuring-the-catalog/user-interface-configuration.md index 2c8fcaf66c1..9f3072a7657 100644 --- a/docs/manual/docs/administrator-guide/configuring-the-catalog/user-interface-configuration.md +++ b/docs/manual/docs/administrator-guide/configuring-the-catalog/user-interface-configuration.md @@ -60,22 +60,23 @@ To add a new configuration, such as for a sub-portal (see [Portal configuration] - **Search application**: Select this check box to determine whether the search application is visible in the top toolbar. If not set, no link is shown. - **Application URL**: Define the URL for the search application. In the majority of cases this can be left as the default. - **Number of records per page**: Define the options to determine the number of records shown per page of results, and the default. -- **Type of facet**: Define the set of search facets should be visible in the search page. The default is `details` but `manager` can be used to show the facets more normally used on the editor page. -- **Default search**: Define a default filter for the search. +- **Facet configuration**: See [Configuring faceted search](../../customizing-application/configuring-faceted-search.md)). The configuration are defined using JSON following Elasticsearch API (See . ![](img/ui-settings-searchpage.png) -- **Facet field to display using tabs**: This option creates a tab for each configured facet above the search results. This can be used to further narrow down the search results. The list of facet names can be found at . For example, to include the Topic Category filter above the search results, the administrator would add `topicCat` as the facet field to display. -- **List of facets**: This can be used to restrict the facets available for searching. For example, adding `topicCat` to this list would restrict the search options to `Topic Category` only. This can be useful for restricting the search options in a sub-portal or external web application. To add additional facets to the list, select the blue `+` button. +- **Facet field to display using tabs**: This option creates a tab for each configured facet above the search results. This can be used to further narrow down the search results. - **Filters**: Define additional search criteria added to all searches and again are used primarily for external applications and sub-portals. - -![](img/ui-settings-searchpage2.png) - - **Type of sort options**: Define the different ways by which a user can sort a set of search results. The **default sort by option** is shown below. Note that to search for example on `title` in alphabetical order it is necessary to set the order to `reverse`. - **List of templates for search results**: This section allows the administrator to configure templates for the layout of the search results. The default is `grid` whereas `list` is the default for the editor board. ![](img/ui-settings-searchpage3.png) + +- **Similar records** or **More like this**: Define the query used to search for similar records that are displayed at the bottom of the record view. + +![](img/morelikethisconfig.png) + + - **Default template used for search results**: Define the template page for the search. Generally this can be left as the default. - **List of formatter for record view**: Determine the formatter used to display the search results. See [Customizing metadata views](../../customizing-application/creating-custom-view.md) for information on creating a new formatter. To add an additional view, click the blue `+` button below the list and provide a name and a URL. diff --git a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js index f91c671e018..e1ca1871d49 100644 --- a/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js +++ b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js @@ -178,12 +178,28 @@ var resourceType = scope.md.resourceType ? scope.md.resourceType[0] : undefined; + var filter = []; if (scope.ofSameType && resourceType) { var mapping = resourceTypeMapping[resourceType]; scope.label = mapping ? mapping.label : resourceType; - query.query.bool.filter = [ - { terms: { resourceType: mapping ? mapping.types : [resourceType] } } - ]; + filter.push({ + terms: { resourceType: mapping ? mapping.types : [resourceType] } + }); + } + + if ( + gnGlobalSettings.gnCfg.mods.search.moreLikeThisFilter && + gnGlobalSettings.gnCfg.mods.search.moreLikeThisFilter != "" + ) { + filter.push({ + query_string: { + query: gnGlobalSettings.gnCfg.mods.search.moreLikeThisFilter + } + }); + } + + if (filter.length > 0) { + query.query.bool.filter = filter; } return query; diff --git a/web-ui/src/main/resources/catalog/js/CatController.js b/web-ui/src/main/resources/catalog/js/CatController.js index f9ae78f9e83..65b8d949d76 100644 --- a/web-ui/src/main/resources/catalog/js/CatController.js +++ b/web-ui/src/main/resources/catalog/js/CatController.js @@ -370,6 +370,8 @@ size: 20 }, moreLikeThisSameType: true, + moreLikeThisFilter: + "-cl_status.key:(obsolete OR historicalArchive OR superseded)", moreLikeThisConfig: { more_like_this: { fields: [ @@ -1322,6 +1324,7 @@ "geocoder", "disabledTools", "filters", + "info", "scoreConfig", "autocompleteConfig", "moreLikeThisConfig", diff --git a/web-ui/src/main/resources/catalog/locales/en-admin.json b/web-ui/src/main/resources/catalog/locales/en-admin.json index 81d7da738e0..7f3cd11fd34 100644 --- a/web-ui/src/main/resources/catalog/locales/en-admin.json +++ b/web-ui/src/main/resources/catalog/locales/en-admin.json @@ -1082,6 +1082,7 @@ "ui-mod-header": "Top toolbar", "ui-mod-footer": "Footer", "ui-mod-cookieWarning": "Cookie warning", + "ui-mod-directory": "Directory", "ui-createPageTpl": "New metadata page layout", "ui-createPageTpl-horizontal": "Horizontal", "ui-createPageTpl-vertical": "Vertical", diff --git a/web-ui/src/main/resources/catalog/locales/en-v4.json b/web-ui/src/main/resources/catalog/locales/en-v4.json index dc8e786767d..59927c5984e 100644 --- a/web-ui/src/main/resources/catalog/locales/en-v4.json +++ b/web-ui/src/main/resources/catalog/locales/en-v4.json @@ -164,12 +164,14 @@ "dropIndexAndRebuild": "Delete index and reindex", "rebuildIndexHelp": "While rebuilding index, search may return incomplete results and the CSW GetRecords operation can be disabled (if you selected the option in the settings). Use this function, when catalog traffic is low. It's recommended to rebuild index manually from here when making changes directly in the database. If you change index mapping (cf. records.json), then you have to click on 'Delete index and reindex'.", "indexInEsDoneError": "There is an error with the index. See the logs for details", - "indexInEsDone": "The indexing operation was successfull", + "indexInEsDone": "The indexing operation was successful", "indexCommit": "Commit index changes", "indexCommit-help": "To use only if indexing task is hanging.", "indexCommitError": "Error while committing index changes.", "ui-moreLikeThisConfig": "More like this configuration", - "ui-moreLikeThisConfig-help": "Configuration must have a more_like_this.like which will be set with the record title to search for similar records.", + "ui-moreLikeThisConfig-help": "Configuration must have a more_like_this.like which will be set with the record title to search for similar records. (See Elasticsearch API).", + "ui-moreLikeThisFilter": "More like this query filter", + "ui-moreLikeThisFilter-help": "Optional filter expression to apply on the more like this query (eg.
-cl_status.key:(obsolete OR historicalArchive OR superseded)
to exclude obsolete records).", "ui-autocompleteConfig": "Autocompletion configuration", "ui-autocompleteConfig-help": "Configuration must have a query.multi_match.query which will be set on autocompletion.", "ui-facetConfig": "Facets configuration",