generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from eea/develop
New globalsearchbase config
- Loading branch information
Showing
8 changed files
with
156 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import { build_runtime_mappings } from '../utils'; | ||
import clusterParams, { clusters } from './clusters'; | ||
|
||
import facets from './facets'; | ||
import views from './views'; | ||
import query from './query'; | ||
import filters from './filters'; | ||
import download from './download'; | ||
import vocabs from './vocabulary'; | ||
|
||
import objectProvidesWhitelist from './json/objectProvidesWhitelist.json'; | ||
import spatialWhitelist from './json/spatialWhitelist.json'; | ||
import placesBlacklist from './json/placesBlacklist.json'; | ||
import typesWhitelist from './json/typesWhitelist.json'; | ||
|
||
const globalSearchBaseConfig = { | ||
title: 'Global search and catalogue', | ||
layoutComponent: 'TopFilterLayout', | ||
contentBodyComponent: 'FilterAsideContentView', | ||
enableNLP: true, // enables NLP capabilities | ||
facetsListComponent: 'DropdownFacetsList', | ||
runtime_mappings: build_runtime_mappings(clusters), | ||
useSearchPhrases: false, | ||
searchAsYouType: false, | ||
landingPageURL: '/en/advanced-search', | ||
getActiveFilters: 'getGlobalSearchActiveFilters', | ||
|
||
...vocabs, | ||
...facets, | ||
...views, | ||
...query, | ||
...filters, | ||
...download, | ||
...clusterParams, | ||
|
||
sourceExcludedFields: ['embedding'], // don't need these in results | ||
// 'fulltext', | ||
|
||
// these are used to "clean" the values in the results. | ||
field_filters: { | ||
type: { | ||
whitelist: typesWhitelist, | ||
}, | ||
objectProvides: { | ||
whitelist: objectProvidesWhitelist, | ||
}, | ||
spatial: { | ||
whitelist: spatialWhitelist, | ||
}, | ||
places: { | ||
blacklist: placesBlacklist, | ||
}, | ||
}, | ||
|
||
highlight: { | ||
queryParams: { | ||
fragment_size: 200, | ||
number_of_fragments: 3, | ||
}, | ||
fields: ['description.highlight'], | ||
queryBuilder: { | ||
factory: 'highlightQueryBuilder', | ||
}, | ||
}, | ||
|
||
sortOptions: [ | ||
{ | ||
name: 'Title a-z', | ||
value: 'title.index', | ||
direction: 'asc', | ||
}, | ||
{ | ||
name: 'Title z-a', | ||
value: 'title.index', | ||
direction: 'desc', | ||
}, | ||
{ | ||
name: 'Oldest', | ||
value: 'issued.date', | ||
direction: 'asc', | ||
}, | ||
{ | ||
name: 'Newest', | ||
value: 'issued.date', | ||
direction: 'desc', | ||
}, | ||
], | ||
|
||
defaultPromptQueries: [ | ||
'what is the status of our forests', | ||
'what is PFAS?', | ||
'how does PFAS get into human?', | ||
'what is the cumulative surface area of the Natura 2000?', | ||
'what percentage of europe population is connected to waste water treatement?', | ||
'How is the status of fish species in Europe?', | ||
'What is the BISE?', | ||
'how much does transport contributes to GHG emissions in EU?', | ||
'Which cities in Europe have the worst air quality?', | ||
'What car is best for the environment?', | ||
'What transport mode is best for the environment?', | ||
'What EU legislation safeguards our water?', | ||
'What is land accounting?', | ||
'What countries had the highest land take in the EEA-39 between 2000 and 2018?', | ||
'Why is urban sprawl bad?', | ||
'what are controlled substances', | ||
'what is plastic', | ||
'What year did car manufacturers meet their binding emissions target?', | ||
'What is the percentage of surface water bodies with less than good status?', | ||
'What is the most common pollutant in water bodies in Europe?', | ||
'Where can I access greenhouse gas data', | ||
'What is the trend on greenhouse gas emissions from transport', | ||
'what is the best transport mode', | ||
'what are ecosystem services', | ||
'bathing water quality', | ||
'greenhouse gas emissions trends', | ||
'waste generation trends', | ||
], | ||
}; | ||
|
||
export default globalSearchBaseConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,120 +1,11 @@ | ||
import { build_runtime_mappings } from '../utils'; | ||
import clusterParams, { clusters } from './clusters'; | ||
import cloneDeep from 'lodash.clonedeep'; | ||
|
||
import facets from './facets'; | ||
import views from './views'; | ||
import query from './query'; | ||
import filters from './filters'; | ||
import download from './download'; | ||
import vocabs from './vocabulary'; | ||
import globalSearchBaseConfig from './global-search-base-config.js'; | ||
|
||
import objectProvidesWhitelist from './json/objectProvidesWhitelist.json'; | ||
import spatialWhitelist from './json/spatialWhitelist.json'; | ||
import placesBlacklist from './json/placesBlacklist.json'; | ||
import typesWhitelist from './json/typesWhitelist.json'; | ||
let globalSearchConfig = cloneDeep(globalSearchBaseConfig); | ||
|
||
const globalSearchConfig = { | ||
title: 'Global search and catalogue', | ||
layoutComponent: 'TopFilterLayout', | ||
contentBodyComponent: 'FilterAsideContentView', | ||
enableNLP: true, // enables NLP capabilities | ||
facetsListComponent: 'DropdownFacetsList', | ||
runtime_mappings: build_runtime_mappings(clusters), | ||
useSearchPhrases: false, | ||
searchAsYouType: false, | ||
landingPageURL: '/en/advanced-search', | ||
getActiveFilters: 'getGlobalSearchActiveFilters', | ||
|
||
...vocabs, | ||
...facets, | ||
...views, | ||
...query, | ||
...filters, | ||
...download, | ||
...clusterParams, | ||
|
||
sourceExcludedFields: ['embedding'], // don't need these in results | ||
// 'fulltext', | ||
|
||
// these are used to "clean" the values in the results. | ||
field_filters: { | ||
type: { | ||
whitelist: typesWhitelist, | ||
}, | ||
objectProvides: { | ||
whitelist: objectProvidesWhitelist, | ||
}, | ||
spatial: { | ||
whitelist: spatialWhitelist, | ||
}, | ||
places: { | ||
blacklist: placesBlacklist, | ||
}, | ||
}, | ||
|
||
highlight: { | ||
queryParams: { | ||
fragment_size: 200, | ||
number_of_fragments: 3, | ||
}, | ||
fields: ['description.highlight'], | ||
queryBuilder: { | ||
factory: 'highlightQueryBuilder', | ||
}, | ||
}, | ||
|
||
sortOptions: [ | ||
{ | ||
name: 'Title a-z', | ||
value: 'title.index', | ||
direction: 'asc', | ||
}, | ||
{ | ||
name: 'Title z-a', | ||
value: 'title.index', | ||
direction: 'desc', | ||
}, | ||
{ | ||
name: 'Oldest', | ||
value: 'issued.date', | ||
direction: 'asc', | ||
}, | ||
{ | ||
name: 'Newest', | ||
value: 'issued.date', | ||
direction: 'desc', | ||
}, | ||
], | ||
|
||
defaultPromptQueries: [ | ||
'what is the status of our forests', | ||
'what is PFAS?', | ||
'how does PFAS get into human?', | ||
'what is the cumulative surface area of the Natura 2000?', | ||
'what percentage of europe population is connected to waste water treatement?', | ||
'How is the status of fish species in Europe?', | ||
'What is the BISE?', | ||
'how much does transport contributes to GHG emissions in EU?', | ||
'Which cities in Europe have the worst air quality?', | ||
'What car is best for the environment?', | ||
'What transport mode is best for the environment?', | ||
'What EU legislation safeguards our water?', | ||
'What is land accounting?', | ||
'What countries had the highest land take in the EEA-39 between 2000 and 2018?', | ||
'Why is urban sprawl bad?', | ||
'what are controlled substances', | ||
'what is plastic', | ||
'What year did car manufacturers meet their binding emissions target?', | ||
'What is the percentage of surface water bodies with less than good status?', | ||
'What is the most common pollutant in water bodies in Europe?', | ||
'Where can I access greenhouse gas data', | ||
'What is the trend on greenhouse gas emissions from transport', | ||
'what is the best transport mode', | ||
'what are ecosystem services', | ||
'bathing water quality', | ||
'greenhouse gas emissions trends', | ||
'waste generation trends', | ||
], | ||
}; | ||
globalSearchConfig.facets = globalSearchConfig.facets.filter( | ||
(facet) => facet['field'] !== 'subject.keyword', | ||
); | ||
|
||
export default globalSearchConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters