@eeacms/volto-globalsearch 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.0.15](https://github.com/eea/volto-globalsearch/compare/1.0.14...1.0.15) - 14 March 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - use registry.resolve for healthcheck [Zoltan Szabo - [`77ac70f`](https://github.com/eea/volto-globalsearch/commit/77ac70f2b82c8db9a22f9a6d3ccae901d9b10002)]
12
+ - Add healthcheck [Tiberiu Ichim - [`1860323`](https://github.com/eea/volto-globalsearch/commit/1860323629fa54fbd52ecf9d16ac5ccd0a3a8f7d)]
7
13
  ### [1.0.14](https://github.com/eea/volto-globalsearch/compare/1.0.13...1.0.14) - 10 March 2023
8
14
 
9
15
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-globalsearch",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "@eeacms/volto-globalsearch: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -22,7 +22,8 @@ const globalSearchBaseConfig = {
22
22
  runtime_mappings: build_runtime_mappings(clusters),
23
23
  useSearchPhrases: false,
24
24
  searchAsYouType: false,
25
- landingPageURL: '/en/advanced-search',
25
+ landingPageURL: null,
26
+ healthcheck: 'getGlobalSearchHealthcheck',
26
27
  getActiveFilters: 'getGlobalSearchActiveFilters',
27
28
 
28
29
  ...vocabs,
@@ -3,6 +3,7 @@ import cloneDeep from 'lodash.clonedeep';
3
3
  import globalSearchBaseConfig from './global-search-base-config.js';
4
4
 
5
5
  let globalSearchConfig = cloneDeep(globalSearchBaseConfig);
6
+ globalSearchConfig.landingPageURL = '/en/advanced-search';
6
7
 
7
8
  globalSearchConfig.facets = globalSearchConfig.facets.filter(
8
9
  (facet) => facet['field'] !== 'subject.keyword',
@@ -0,0 +1,23 @@
1
+ import runRequest from '@eeacms/search/lib/runRequest';
2
+ import buildRequest from '@eeacms/search/lib/search/query';
3
+
4
+ export default function healthcheck(appConfig) {
5
+ // is index ok?
6
+ // return index update date
7
+ // run default query, see number of results
8
+ // nlpservice provides answer based on extracted term
9
+ // number of documents with error in data raw, type of error
10
+
11
+ return new Promise((resolve, reject) => {
12
+ const body = buildRequest({ filters: [] }, appConfig);
13
+ runRequest(body, appConfig).then((resp) => {
14
+ let total;
15
+ try {
16
+ total = resp.body.hits.total.value;
17
+ resolve({ documentCount: total });
18
+ } catch {
19
+ reject({ total: -1 });
20
+ }
21
+ });
22
+ });
23
+ }
@@ -4,6 +4,8 @@ import {
4
4
  isFilterValueDefaultValue,
5
5
  } from '@eeacms/search';
6
6
  import { getGlobalsearchThumbUrl, getGlobalsearchIconUrl } from './../utils';
7
+ import healthcheck from './healthcheck';
8
+
7
9
  import { typesForClustersOptionsFilter } from './clusters';
8
10
 
9
11
  import { UniversalCard } from '@eeacms/volto-listing-block';
@@ -108,6 +110,8 @@ export default function install(config) {
108
110
  },
109
111
  };
110
112
 
113
+ config.resolve.getGlobalSearchHealthcheck = healthcheck;
114
+
111
115
  config.resolve.getGlobalsearchIconUrl = getGlobalsearchIconUrl(
112
116
  contentTypeNormalize,
113
117
  );