@eeacms/volto-globalsearch
v2.1.2
Published
@eeacms/volto-globalsearch: Volto add-on
Readme
volto-globalsearch
EEA Elastic Search Block with NLP integration Volto add-on
Features

Demo
- https://demo-www.eea.europa.eu/en/advanced-search
Getting started
Try volto-globalsearch with Docker
git clone https://github.com/eea/volto-globalsearch.git
cd volto-globalsearch
make
make startGo to http://localhost:3000
Add volto-globalsearch to your Volto project
Make sure you have a Plone backend up-and-running at http://localhost:8080/Plone
docker compose up backendStart Volto frontend
If you already have a volto project, just update
package.json:"addons": [ "@eeacms/volto-globalsearch" ], "dependencies": { "@eeacms/volto-globalsearch": "*" }If not, create one:
npm install -g yo @plone/generator-volto yo @plone/volto my-volto-project --canary --addon @eeacms/volto-globalsearch cd my-volto-project
Install new add-ons and restart Volto:
yarn yarn startGo to http://localhost:3000
Happy editing!
Customizing the volto-searchblock
Modifying Clusters
To customize the behavior of the volto-searchblock in your volto theme addon, you can modify clusters by following these steps:
Find or create
index.jsin thesrc/configIn your theme addon, create the
src/config/index.jsfile. You can refer to the example file in thevolto-marine-themerepository.Locate and Modify Clusters
Clusters are found in
config.searchui.<name_of_search>.runtime_mappings. For example, in the case of thevolto-marine-theme, the<name_of_search>wasmarinemeasure, and clusters are located inconfig.searchui.marinemeasure.runtime_mappings.Use
build_runtime_mappingsYou have to pass the clusters transformed by build_runtime_mappings function. Import the
build_runtime_mappingsas follows:import { build_runtime_mappings } from '@eeacms/volto-globalsearch/utils';Default Clusters
Default clusters are defined here. Decide whether you want to override all clusters or modify specific ones. If you decided to modify them, you can import them in your addon as follows:
import { clusters } from '@eeacms/volto-globalsearch/config/clusters';Example Modification
Here's an example of how the Publications cluster was modified in the CountryFactsheet by keeping the rest as default: https://github.com/eea/volto-marine-theme/pull/43/files.
Cluster Structure
Be aware that a cluster contains the
valueskey that holds thecontent typeson which the cluster will act.
Release
See RELEASE.md.
How to contribute
See DEVELOP.md.
Copyright and license
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
See LICENSE.md for details.
