EEA Elastic Search Block with NLP integration Volto add-on
git clone https://github.com/eea/volto-globalsearch.git
cd volto-globalsearch
make
make start
Go to http://localhost:3000
-
Make sure you have a Plone backend up-and-running at http://localhost:8080/Plone
docker compose up backend
-
Start 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 start
-
Go to http://localhost:3000
-
Happy editing!
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.js
in thesrc/config
In your theme addon, create the
src/config/index.js
file. You can refer to the example file in thevolto-marine-theme
repository. -
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_mappings
You have to pass the clusters transformed by build_runtime_mappings function. Import the
build_runtime_mappings
as 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
values
key that holds thecontent types
on which the cluster will act.
See RELEASE.md.
See DEVELOP.md.
The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.
See LICENSE.md for details.