@eeacms/volto-globalsearch
v4.0.0
Published
@eeacms/volto-globalsearch: Volto add-on
Downloads
731
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
make start now defaults to Volto 18. To run the same setup against Volto 17, use:
VOLTO_VERSION=17 make
VOLTO_VERSION=17 make startAdd 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:"dependencies": { "@eeacms/volto-globalsearch": "*" }and
volto.config.js:const addons = ['@eeacms/volto-globalsearch'];If not, create one with Cookieplone, as recommended by the official Plone documentation for Volto 18+:
uvx cookieplone project cd project-title
Install or update dependencies, then start the project:
make installFor a Cookieplone project, start the backend and frontend in separate terminals:
make backend-start make frontend-startFor a legacy Volto 17 project, install the package with
yarnand restart the frontend as usual.Go 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.
