@eeacms/volto-globalsearch 1.0.17 → 1.0.19

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,16 @@ 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.19](https://github.com/eea/volto-globalsearch/compare/1.0.18...1.0.19) - 25 July 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - extended healthcheck with info about the index & elapsed time for queries on nlp [Zoltan Szabo - [`f7fb5ae`](https://github.com/eea/volto-globalsearch/commit/f7fb5ae0afae1f3f57b4ae96547c42bd5bccaa10)]
12
+ ### [1.0.18](https://github.com/eea/volto-globalsearch/compare/1.0.17...1.0.18) - 10 July 2023
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - added new sites [Zoltan Szabo - [`a111d65`](https://github.com/eea/volto-globalsearch/commit/a111d65b686ebb515750a9e495dbcc4278bedd17)]
7
17
  ### [1.0.17](https://github.com/eea/volto-globalsearch/compare/1.0.16...1.0.17) - 12 June 2023
8
18
 
9
19
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-globalsearch",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "@eeacms/volto-globalsearch: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -140,6 +140,12 @@ export default {
140
140
  cab: {
141
141
  url: require('../static/cab-logo.png'),
142
142
  },
143
+ discomap: {
144
+ url: require('../static/eea-logo.svg'),
145
+ },
146
+ noise: {
147
+ url: require('../static/eea-logo.svg'),
148
+ },
143
149
  },
144
150
  Countries: {
145
151
  fallback: {
@@ -234,6 +234,7 @@ const facets = [
234
234
  dateRangeFacet({
235
235
  field: 'issued.date',
236
236
  label: ' ',
237
+ allow_missing: false,
237
238
  activeFilterLabel: 'Published',
238
239
  isFilter: true, // filters don't need facet options to show up
239
240
  showInFacetsList: false,
@@ -255,6 +256,10 @@ const facets = [
255
256
  values: ['Last 5 years'],
256
257
  type: 'any',
257
258
  },
259
+ missing: {
260
+ values: ['All time'],
261
+ type: 'any',
262
+ },
258
263
  }),
259
264
  multiTermFacet({
260
265
  field: 'language',
@@ -1,23 +1,33 @@
1
1
  import runRequest from '@eeacms/search/lib/runRequest';
2
2
  import buildRequest from '@eeacms/search/lib/search/query';
3
+ import getInfo from '@eeacms/search/lib/getIndexInfo';
3
4
 
4
- export default function healthcheck(appConfig) {
5
+ export default async function healthcheck(appConfig) {
5
6
  // is index ok?
6
7
  // return index update date
7
8
  // run default query, see number of results
8
9
  // nlpservice provides answer based on extracted term
9
10
  // number of documents with error in data raw, type of error
10
11
 
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
- });
12
+ return new Promise(async (resolve, reject) => {
13
+ try {
14
+ const body_total = buildRequest({ filters: [] }, appConfig);
15
+
16
+ const resp_total = await runRequest(body_total, appConfig);
17
+ const total = resp_total.body.hits.total.value;
18
+
19
+ const body_nlp = buildRequest(
20
+ { filters: [], searchTerm: 'what is bise?' },
21
+ appConfig,
22
+ );
23
+ const resp_nlp = await runRequest(body_nlp, appConfig);
24
+ const elapsed = resp_nlp.body.elapsed;
25
+
26
+ const info = await getInfo(appConfig);
27
+
28
+ resolve({ documentCount: total, elapsed: elapsed, index_info: info });
29
+ } catch {
30
+ reject({ total: -1 });
31
+ }
22
32
  });
23
33
  }
@@ -55,6 +55,8 @@ const vocab = {
55
55
  'etc-wmge': 'ETC on Waste and Materials in Green Economy',
56
56
  sdi: 'Datahub',
57
57
  cab: 'Climate Advisory Board',
58
+ discomap: 'DiscoMap',
59
+ noise: 'NOISE Observation & Information Service for Europe',
58
60
  },
59
61
  };
60
62