All Planet 4 sites are powered by Elastic Search, an open-source engine providing scalable, near real-time and multi-tenancy crawls. Elastic Search allows P4 to incorporate 3rd parties crawls, and will be super useful in the future, for instance to include Archived P3 sites in the search results.
The search results page
Anytime one or more terms are inserted in the search box, Elastic Search will pull out a page with the following url structure:
- https://www.greenpeace.org/domain/?s=KEY1+KEY2+KEY3&orderby=_score
Here’s an example > https://www.greenpeace.org/new-zealand/?s=Polar+bear&orderby=_score
By default, Take Action pages and Campaigns pages are the first ones displayed into the results, as the most relevant content. Posts are also pulled out right after, showing their Post type, #Tags and Excerpt.
Filters
On the left side of the search results page, users can refine search according to:
>> one or more Issues (Aka Categories)
>> one or more Campaigns (Aka #Tags)
>> one or more Categories (Aka Post types)
>> one or several content type (pages, documents, etc)
By selecting a filter, a query will be added to the url, for example, if to our previous search results page we add the “#Forest” Tag, the result will be:
https://www.greenpeace.org/domain/?s=KEY1+KEY2+KEY3&orderby=_score&f%5Btag%5D%5BForests%5D=20
An “Archive” filter will also be available in case Admins decide to include Archived content in Search pages (see below at #integration-with-archived-content)
Search weight in Posts / Pages
As mentioned,, Take Action pages are pulled out first, with default weight 2000, then Pages with default weight 100 and then the rest of the Posts. Editors can, however, manually determine the search weight of the page / post (See create Posts & Pages).
The Search function will present first posts or pages with the higher search weight.
- 1 >> Minimum weight
- 100 >> Default (normal) Page weight
- 2000 >> Default Action Page weight
- 3000 >> Maximum weight
Integration with the Archive
It is possible to include Archived content from the Greenpeace collection in the Internet Archive among the P4 search results, allowing users to access historical content from P3 (or previous versions of Greenpeace websites).
KEY INFO #1 – This is a Minimum Viable Product of the basic integration of Greenpeace archives into P4. Help the team improve it by adding your requirements!
KEY INFO #2 – Only “published” Archived content are included in P4 Search results. You can Include / Exclude specific Archived posts / pages from Settings > Archive > All Archived Content
In Settings > Archive > All archived posts, all p3 content is marked with “[email protected]” as creator. This is an auto-generated profile that gets assigned as author of all p3 archived content, with the lowest (subscriber) permissions role.
This profile is not going to perform any action, but if you if you try to delete the “[email protected]” user, you’ll get a prompt to re-assign the archive posts authorship.
KEY INFO #3 – Content that was migrated to P4 during implementation is not available among the Archived Content, to avoid duplicates
Setup of the archive integration
P4 Administrators can choose to include content from the Greenpeace collection of the Internet Archive among Planet 4 search results.
KEY INFO #1 – By default, the Archive content integration is OFF.
KEY INFO #2 – By enabling this option, content from the Greenpeace collection of the Internet archived will be included in P4 search results
As a P4 Administrator go to Settings > Planet 4, and locate the command to turn on / off the Archive integration for specific users.
- for nobody – The Command is OFF (Default)
- for logged in users – Only users who Login will see the Archived Content when searching in P4
- for all users – Everyone will see Archived content when searching in P4
TIP – We recommend making the archived results available first for the logged in users and run some test. Then the archived content can be included for all users.
How archived content is presented
Archived Search results are presented as follows:
- Include Title, date of original publication and description (if applicable)
- Will open in a new tab (users will be leaving P4)
- With an “Archive” green label
- Without taxonomy (no #Tags or Categories)
- Without featured image
- Archived search results should be pulled out from the same instance of the Wayback machine in the same instance of P4
- For multilingual sites, archived search results should be pulled out in the same language of the Wayback machine into the same language of the P4 search results
If the setting to Include archived content in Search for… is checked, users performing a search will be presented the option to include archived content among the P4 search results or not. Here’s how this will happen:
- if the option to display Archive is ticked in the menu on the right, then only archived content will be displayed on the page
- if the option to display Archive is NOT ticked in the menu on the right side, then the search query will display content from both P4 and the archive
- the results are displayed considering their relevance – first, calculated by how much they match the search term, then the relevancy score is lowered depending on the date
How the Archive integration works
Search keys, subdirectories and language variations will be maintained when browsing the WayBack Machine archive subdirectory. This means that:
- if a user searches “Arctic, Oil” in greenpeace.org/AFRICA/en
- the integration will pull out content from:
- https://wayback.archive-it.org/9650/20191111195207/http://p3-raw.greenpeace.org/africa/en/
- containing “ARCTIC” + “OIL”
Test the archive integration
We recommend to run some tests before activating the “Archived content” integration for all users.
For All sites
- Activate the Archive Integration setting in your Release site (e.g. https://release.k8s.p4.greenpeace.org/YOUR-NRO)
- see “Setup-of-the-archive-integration” above
- Search for broad keywords (e.g. “Arctic”, “Amazon” and “Nestle”)
- Search for very specific keywords (e.g. “Munduruku”, “Generali”, “Kriza” or any related to a term in your site’s taxonomy)
Expected results:
Make sure the content follows the rules from the section above “How archived content is presented“
👉👉👉 Not working? Please report a bug 🐞
For multi-language sites
- Activate the Archive Integration setting in your Release site (e.g. https://release.k8s.p4.greenpeace.org/YOUR-NRO)
- see “Setup-of-the-archive-integration” above
- Search for broad keywords (e.g. “Arctic”, “Amazon” and “Nestle”) in all language versions
- Search for very specific keywords (e.g. “Munduruku”, “Generali”, “Kriza” or any related to a term in your site’s taxonomy) in all language versions
Expected results:
- Make sure the content follows the rules from the section above “How archived content is presented“
- The Archived results correspond to the language of the keyword (for eg, if the search term is in FR, make sure the results are French results)
- Archived search results are pulled out in the same language of the Wayback machine into the same language of the P4 search results
👉👉👉 Not working? Please report a bug 🐞
Elastic Search configuration and Sync
As Admin, go to Settings > ElasticPress.
The ElasticSearch host is `http://p4-es-elasticsearch-client.default.svc.cluster.local:9200/` and should automatically be set for all P4 sites.
If this is not configured in your site, insert the host above then hit “Sync”, leaving all the search settings enabled. This will create an index of the pages/posts/documents that exist in the currently used language.
KEY INFO – For Multilingual NRO sites you will need to run a “Sync” for each one of the available languages. So, you will need to change language in the admin panel and do it again.
Questions or doubts? Contact the P4 team.
ElasticSearch intro video
Check the official Elastic site or watch the video below to learn more about what Elastic Search does..
Advanced config – tech documentation
Are you a Dev / ElasticSearch specialist? Check this page to learn how Planet4 uses it and how you can do advanced customisation.
Links & Resources
- External links
- Elastic Search website