@eeacms/volto-globalsearch 1.0.11 → 1.0.12
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 +8 -0
- package/package.json +1 -1
- package/src/config/clusters.js +1 -0
- package/src/config/facets.js +9 -0
- package/src/config/global-search-base-config.js +120 -0
- package/src/config/global-search-config.js +6 -115
- package/src/config/index.js +7 -0
- package/src/index.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ 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.12](https://github.com/eea/volto-globalsearch/compare/1.0.11...1.0.12) - 1 March 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Prettier [Tiberiu Ichim - [`d2fced6`](https://github.com/eea/volto-globalsearch/commit/d2fced6fb614b7b2dca3ff1425ce33400a085a5d)]
|
|
12
|
+
- removed unused imports [Zoltan Szabo - [`f6d7dc4`](https://github.com/eea/volto-globalsearch/commit/f6d7dc4f787005027a102fb513aa2e8aba5ffba9)]
|
|
13
|
+
- Added 'Publication reference' to the 'Others' cluster [Zoltan Szabo - [`73e289d`](https://github.com/eea/volto-globalsearch/commit/73e289deb8e841610575ff92095506b7279ecbc5)]
|
|
14
|
+
- Refs #241801; Added searchengine with new facet for keywords [Zoltan Szabo - [`654f3ca`](https://github.com/eea/volto-globalsearch/commit/654f3ca1ba79190c721bf200f24808b31c79be8f)]
|
|
7
15
|
### [1.0.11](https://github.com/eea/volto-globalsearch/compare/1.0.10...1.0.11) - 14 February 2023
|
|
8
16
|
|
|
9
17
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
package/src/config/clusters.js
CHANGED
package/src/config/facets.js
CHANGED
|
@@ -101,6 +101,15 @@ const facets = [
|
|
|
101
101
|
showAllOptions: true, // show all options (even if 0) in modal facet
|
|
102
102
|
alwaysVisible: true,
|
|
103
103
|
}),
|
|
104
|
+
multiTermFacet({
|
|
105
|
+
field: 'subject.keyword',
|
|
106
|
+
isFilterable: true,
|
|
107
|
+
isMulti: true,
|
|
108
|
+
label: 'Keywords',
|
|
109
|
+
show: 10000,
|
|
110
|
+
showAllOptions: true, // show all options (even if 0) in modal facet
|
|
111
|
+
alwaysVisible: false,
|
|
112
|
+
}),
|
|
104
113
|
multiTermFacet({
|
|
105
114
|
field: 'spatial',
|
|
106
115
|
isFilterable: true,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { build_runtime_mappings } from '../utils';
|
|
2
|
+
import clusterParams, { clusters } from './clusters';
|
|
3
|
+
|
|
4
|
+
import facets from './facets';
|
|
5
|
+
import views from './views';
|
|
6
|
+
import query from './query';
|
|
7
|
+
import filters from './filters';
|
|
8
|
+
import download from './download';
|
|
9
|
+
import vocabs from './vocabulary';
|
|
10
|
+
|
|
11
|
+
import objectProvidesWhitelist from './json/objectProvidesWhitelist.json';
|
|
12
|
+
import spatialWhitelist from './json/spatialWhitelist.json';
|
|
13
|
+
import placesBlacklist from './json/placesBlacklist.json';
|
|
14
|
+
import typesWhitelist from './json/typesWhitelist.json';
|
|
15
|
+
|
|
16
|
+
const globalSearchBaseConfig = {
|
|
17
|
+
title: 'Global search and catalogue',
|
|
18
|
+
layoutComponent: 'TopFilterLayout',
|
|
19
|
+
contentBodyComponent: 'FilterAsideContentView',
|
|
20
|
+
enableNLP: true, // enables NLP capabilities
|
|
21
|
+
facetsListComponent: 'DropdownFacetsList',
|
|
22
|
+
runtime_mappings: build_runtime_mappings(clusters),
|
|
23
|
+
useSearchPhrases: false,
|
|
24
|
+
searchAsYouType: false,
|
|
25
|
+
landingPageURL: '/en/advanced-search',
|
|
26
|
+
getActiveFilters: 'getGlobalSearchActiveFilters',
|
|
27
|
+
|
|
28
|
+
...vocabs,
|
|
29
|
+
...facets,
|
|
30
|
+
...views,
|
|
31
|
+
...query,
|
|
32
|
+
...filters,
|
|
33
|
+
...download,
|
|
34
|
+
...clusterParams,
|
|
35
|
+
|
|
36
|
+
sourceExcludedFields: ['embedding'], // don't need these in results
|
|
37
|
+
// 'fulltext',
|
|
38
|
+
|
|
39
|
+
// these are used to "clean" the values in the results.
|
|
40
|
+
field_filters: {
|
|
41
|
+
type: {
|
|
42
|
+
whitelist: typesWhitelist,
|
|
43
|
+
},
|
|
44
|
+
objectProvides: {
|
|
45
|
+
whitelist: objectProvidesWhitelist,
|
|
46
|
+
},
|
|
47
|
+
spatial: {
|
|
48
|
+
whitelist: spatialWhitelist,
|
|
49
|
+
},
|
|
50
|
+
places: {
|
|
51
|
+
blacklist: placesBlacklist,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
highlight: {
|
|
56
|
+
queryParams: {
|
|
57
|
+
fragment_size: 200,
|
|
58
|
+
number_of_fragments: 3,
|
|
59
|
+
},
|
|
60
|
+
fields: ['description.highlight'],
|
|
61
|
+
queryBuilder: {
|
|
62
|
+
factory: 'highlightQueryBuilder',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
sortOptions: [
|
|
67
|
+
{
|
|
68
|
+
name: 'Title a-z',
|
|
69
|
+
value: 'title.index',
|
|
70
|
+
direction: 'asc',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Title z-a',
|
|
74
|
+
value: 'title.index',
|
|
75
|
+
direction: 'desc',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Oldest',
|
|
79
|
+
value: 'issued.date',
|
|
80
|
+
direction: 'asc',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'Newest',
|
|
84
|
+
value: 'issued.date',
|
|
85
|
+
direction: 'desc',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
|
|
89
|
+
defaultPromptQueries: [
|
|
90
|
+
'what is the status of our forests',
|
|
91
|
+
'what is PFAS?',
|
|
92
|
+
'how does PFAS get into human?',
|
|
93
|
+
'what is the cumulative surface area of the Natura 2000?',
|
|
94
|
+
'what percentage of europe population is connected to waste water treatement?',
|
|
95
|
+
'How is the status of fish species in Europe?',
|
|
96
|
+
'What is the BISE?',
|
|
97
|
+
'how much does transport contributes to GHG emissions in EU?',
|
|
98
|
+
'Which cities in Europe have the worst air quality?',
|
|
99
|
+
'What car is best for the environment?',
|
|
100
|
+
'What transport mode is best for the environment?',
|
|
101
|
+
'What EU legislation safeguards our water?',
|
|
102
|
+
'What is land accounting?',
|
|
103
|
+
'What countries had the highest land take in the EEA-39 between 2000 and 2018?',
|
|
104
|
+
'Why is urban sprawl bad?',
|
|
105
|
+
'what are controlled substances',
|
|
106
|
+
'what is plastic',
|
|
107
|
+
'What year did car manufacturers meet their binding emissions target?',
|
|
108
|
+
'What is the percentage of surface water bodies with less than good status?',
|
|
109
|
+
'What is the most common pollutant in water bodies in Europe?',
|
|
110
|
+
'Where can I access greenhouse gas data',
|
|
111
|
+
'What is the trend on greenhouse gas emissions from transport',
|
|
112
|
+
'what is the best transport mode',
|
|
113
|
+
'what are ecosystem services',
|
|
114
|
+
'bathing water quality',
|
|
115
|
+
'greenhouse gas emissions trends',
|
|
116
|
+
'waste generation trends',
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default globalSearchBaseConfig;
|
|
@@ -1,120 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import clusterParams, { clusters } from './clusters';
|
|
1
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
3
2
|
|
|
4
|
-
import
|
|
5
|
-
import views from './views';
|
|
6
|
-
import query from './query';
|
|
7
|
-
import filters from './filters';
|
|
8
|
-
import download from './download';
|
|
9
|
-
import vocabs from './vocabulary';
|
|
3
|
+
import globalSearchBaseConfig from './global-search-base-config.js';
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
import spatialWhitelist from './json/spatialWhitelist.json';
|
|
13
|
-
import placesBlacklist from './json/placesBlacklist.json';
|
|
14
|
-
import typesWhitelist from './json/typesWhitelist.json';
|
|
5
|
+
let globalSearchConfig = cloneDeep(globalSearchBaseConfig);
|
|
15
6
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
contentBodyComponent: 'FilterAsideContentView',
|
|
20
|
-
enableNLP: true, // enables NLP capabilities
|
|
21
|
-
facetsListComponent: 'DropdownFacetsList',
|
|
22
|
-
runtime_mappings: build_runtime_mappings(clusters),
|
|
23
|
-
useSearchPhrases: false,
|
|
24
|
-
searchAsYouType: false,
|
|
25
|
-
landingPageURL: '/en/advanced-search',
|
|
26
|
-
getActiveFilters: 'getGlobalSearchActiveFilters',
|
|
27
|
-
|
|
28
|
-
...vocabs,
|
|
29
|
-
...facets,
|
|
30
|
-
...views,
|
|
31
|
-
...query,
|
|
32
|
-
...filters,
|
|
33
|
-
...download,
|
|
34
|
-
...clusterParams,
|
|
35
|
-
|
|
36
|
-
sourceExcludedFields: ['embedding'], // don't need these in results
|
|
37
|
-
// 'fulltext',
|
|
38
|
-
|
|
39
|
-
// these are used to "clean" the values in the results.
|
|
40
|
-
field_filters: {
|
|
41
|
-
type: {
|
|
42
|
-
whitelist: typesWhitelist,
|
|
43
|
-
},
|
|
44
|
-
objectProvides: {
|
|
45
|
-
whitelist: objectProvidesWhitelist,
|
|
46
|
-
},
|
|
47
|
-
spatial: {
|
|
48
|
-
whitelist: spatialWhitelist,
|
|
49
|
-
},
|
|
50
|
-
places: {
|
|
51
|
-
blacklist: placesBlacklist,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
highlight: {
|
|
56
|
-
queryParams: {
|
|
57
|
-
fragment_size: 200,
|
|
58
|
-
number_of_fragments: 3,
|
|
59
|
-
},
|
|
60
|
-
fields: ['description.highlight'],
|
|
61
|
-
queryBuilder: {
|
|
62
|
-
factory: 'highlightQueryBuilder',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
sortOptions: [
|
|
67
|
-
{
|
|
68
|
-
name: 'Title a-z',
|
|
69
|
-
value: 'title.index',
|
|
70
|
-
direction: 'asc',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'Title z-a',
|
|
74
|
-
value: 'title.index',
|
|
75
|
-
direction: 'desc',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'Oldest',
|
|
79
|
-
value: 'issued.date',
|
|
80
|
-
direction: 'asc',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'Newest',
|
|
84
|
-
value: 'issued.date',
|
|
85
|
-
direction: 'desc',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
|
|
89
|
-
defaultPromptQueries: [
|
|
90
|
-
'what is the status of our forests',
|
|
91
|
-
'what is PFAS?',
|
|
92
|
-
'how does PFAS get into human?',
|
|
93
|
-
'what is the cumulative surface area of the Natura 2000?',
|
|
94
|
-
'what percentage of europe population is connected to waste water treatement?',
|
|
95
|
-
'How is the status of fish species in Europe?',
|
|
96
|
-
'What is the BISE?',
|
|
97
|
-
'how much does transport contributes to GHG emissions in EU?',
|
|
98
|
-
'Which cities in Europe have the worst air quality?',
|
|
99
|
-
'What car is best for the environment?',
|
|
100
|
-
'What transport mode is best for the environment?',
|
|
101
|
-
'What EU legislation safeguards our water?',
|
|
102
|
-
'What is land accounting?',
|
|
103
|
-
'What countries had the highest land take in the EEA-39 between 2000 and 2018?',
|
|
104
|
-
'Why is urban sprawl bad?',
|
|
105
|
-
'what are controlled substances',
|
|
106
|
-
'what is plastic',
|
|
107
|
-
'What year did car manufacturers meet their binding emissions target?',
|
|
108
|
-
'What is the percentage of surface water bodies with less than good status?',
|
|
109
|
-
'What is the most common pollutant in water bodies in Europe?',
|
|
110
|
-
'Where can I access greenhouse gas data',
|
|
111
|
-
'What is the trend on greenhouse gas emissions from transport',
|
|
112
|
-
'what is the best transport mode',
|
|
113
|
-
'what are ecosystem services',
|
|
114
|
-
'bathing water quality',
|
|
115
|
-
'greenhouse gas emissions trends',
|
|
116
|
-
'waste generation trends',
|
|
117
|
-
],
|
|
118
|
-
};
|
|
7
|
+
globalSearchConfig.facets = globalSearchConfig.facets.filter(
|
|
8
|
+
(facet) => facet['field'] !== 'subject.keyword',
|
|
9
|
+
);
|
|
119
10
|
|
|
120
11
|
export default globalSearchConfig;
|
package/src/config/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import { UniversalCard } from '@eeacms/volto-listing-block';
|
|
|
13
13
|
import contentTypeNormalize from './json/contentTypeNormalize.json';
|
|
14
14
|
import globalSearchConfig from './global-search-config.js';
|
|
15
15
|
|
|
16
|
+
import globalSearchBaseConfig from './global-search-base-config.js';
|
|
17
|
+
|
|
16
18
|
const getClientProxyAddress = () => {
|
|
17
19
|
const url = new URL(window.location);
|
|
18
20
|
url.pathname = '';
|
|
@@ -67,6 +69,11 @@ export default function install(config) {
|
|
|
67
69
|
host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
|
|
68
70
|
};
|
|
69
71
|
|
|
72
|
+
config.searchui.globalsearchbase = {
|
|
73
|
+
...mergeConfig(globalSearchBaseConfig, config.searchui.default),
|
|
74
|
+
elastic_index: 'es',
|
|
75
|
+
host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
|
|
76
|
+
};
|
|
70
77
|
if (typeof window !== 'undefined') {
|
|
71
78
|
config.searchui.globalsearch.host =
|
|
72
79
|
process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
|
package/src/index.js
CHANGED
|
@@ -3,11 +3,14 @@ import installGlobalsearch from './config';
|
|
|
3
3
|
export default (config) => {
|
|
4
4
|
config.settings.searchlib = installGlobalsearch(config.settings.searchlib);
|
|
5
5
|
|
|
6
|
-
const { globalsearch } = config.settings.searchlib.searchui;
|
|
6
|
+
const { globalsearch, globalsearchbase } = config.settings.searchlib.searchui;
|
|
7
7
|
|
|
8
8
|
// Tweak the searchlib config to use the middleware instead of the index
|
|
9
9
|
globalsearch.elastic_index = '_es/globalsearch';
|
|
10
10
|
globalsearch.index_name = 'data_searchui';
|
|
11
11
|
|
|
12
|
+
globalsearchbase.elastic_index = '_es/globalsearch';
|
|
13
|
+
globalsearchbase.index_name = 'data_searchui';
|
|
14
|
+
|
|
12
15
|
return config;
|
|
13
16
|
};
|