Add-on RER for Plone to manage search results in Volto
Project description
RER Voltoplugin Search
Add-on for manage Search results in Volto.
Features
Control panel in plone registry to manage Search settings.
Restapi endpoint that exposes these settings for Volto.
If rer.solrpush is installed and active, the search will be done through SOLR and not Plone catalog.
In results facets there will be also a site_name additional data.
@rer-search endpoint
This endpoint is similar to the original @search one but add an additional information about facets based on this package’s settings and results.
facets is a list of filters that can be used to refine the search, and can be configured in the controlpanel.
The first one is always portal_type, followed by the indexes selected in controlpanel.
Example of @rer-search response:
{
"@id": "http://localhost:8080/Plone/++api++/@rer-search?SearchableText=foo",
"facets": [
{
"index": "group",
"items": [
{
"id": "all",
"items": {},
"label": {
"it": "Tutti i contenuti (5)"
}
},
{
"advanced_filters": {},
"icon": "",
"id": "pagine",
"label": {
"en": "Documents (1)",
"it": "Pagine (1)"
},
"portal_types": [
"Document"
]
},
{
"advanced_filters": {},
"icon": "",
"id": "notizie",
"label": {
"en": "News (2)",
"it": "Notizie (2)"
},
"portal_types": [
"News Item",
"ExternalNews"
]
},
{
"advanced_filters": {},
"icon": "",
"id": "bandi",
"label": {
"en": "Announcements (1)",
"it": "Bandi (1)"
},
"portal_types": [
"Bando"
]
},
{
"advanced_filters": {},
"icon": "",
"id": "file-e-immagini",
"label": {
"en": "Files and images (0)",
"it": "File e immagini (0)"
},
"portal_types": [
"File",
"Image"
]
},
{
"advanced_filters": [
{
"index_end": "end",
"index_start": "start",
"label_end": {
"it": "Data di fine"
},
"label_start": {
"it": "Data di inizio"
},
"type": "DateRangeIndex"
}
],
"icon": "",
"id": "eventi",
"label": {
"en": "Events (1)",
"it": "Eventi (1)"
},
"portal_types": [
"Event"
]
}
],
"label": {
"it": "Cosa"
},
"type": "Groups"
},
{
"index": "Subject",
"items": [
{
"label": "aaa (2)",
"value": "aaa"
},
{
"label": "bbb (1)",
"value": "bbb"
}
],
"label": {
"en": "Keywords",
"it": "Parole chiave"
},
"type": "KeywordIndex"
}
],
"items": [
{
"@id": "http://localhost:8080/Plone/xxx",
"@type": "Document",
"UID": "33fe109d445d4e1db4b46afae8301950",
"description": "",
"id": "xxx",
"image_field": "",
"image_scales": null,
"review_state": "published",
"title": "Pagina foo",
"type_title": "Pagina"
},
...
],
"items_total": 5
}
Advanced filters for groups
In each group types you can select an advanced filter.
Advanced filters are a list of preset filters that allow to add some extra filters when that group is selected in search.
By default there is only one advanced filter called “Events” that add start and end date filters, but you can add more presets in your custom package.
Register new advanced filters
Advanced filters are a list of named adapters, so you can add more and override existing ones if needed.
You just need to register a new named adapter:
<adapter factory = ".my_filters.MyNewFilters" name= "my-filters" />
The adapter should have a label attribute (needed to show a human-readable name in sitesearch-settings view) and return the schema for the additional indexes:
from zope.component import adapter
from zope.interface import implementer
from rer.voltoplugin.search.interfaces import IRERVoltopluginSearchCustomFilters
from zope.interface import Interface
from my.package import _
from zope.i18n import translate
@adapter(Interface, Interface)
@implementer(IRERVoltopluginSearchCustomFilters)
class MyNewFilters(object):
"""
"""
label = _("some_labelid", default=u"Additional filters")
def __init__(self, context, request):
self.context = context
self.request = request
def __call__(self):
return [
{
"index": "xxx",
"items": {},
"label": {"it": "Inizio", "en": "Start"},
"type": "DateIndex",
},
{
"index": "yyy",
"items": {},
"label": {"it": "Fine", "en": "End"},
"type": "DateIndex",
},
]
Where xxx and yyy are Plone’s catalog indexes.
Vocabularies
rer.voltoplugin.search.vocabularies.AdvancedFiltersVocabulary
Vocabulary that returns the list of registered adapters for custom filters based on content-types.
rer.voltoplugin.search.vocabularies.IndexesVocabulary
Vocabulary that returns the list of available indexes in portal_catalog.
rer.voltoplugin.search.vocabularies.GroupingTypesVocabulary
Vocabulary that returns the list of available portal_types.
If rer.solr is installed, returns the list of portal_types indexed in SOLR, otherwise return ReallyUserFriendlyTypes Plone vocabulary.
Volto integration
To use this product in Volto, your Volto project needs to include a new plugin: https://github.com/collective/XXX
Translations
This product has been translated into
Italian
Installation
Install rer.voltoplugin.search by adding it to your buildout:
[buildout]
...
eggs =
rer.voltoplugin.search
and then running bin/buildout
Contribute
Issue Tracker: https://github.com/collective/rer.voltoplugin.search/issues
Source Code: https://github.com/collective/rer.voltoplugin.search
License
The project is licensed under the GPLv2.
Credits
Developed with the support of
Regione Emilia Romagna supports the PloneGov initiative.
Contributors
RedTurtle Technology, sviluppo@redturtle.it
Changelog
1.0.2 (2025-10-01)
Fix facets counts in catalog serializer. [cekk]
1.0.1 (2025-02-20)
Fix path for SOLR searches. [cekk]
1.0.0 (2025-02-04)
Initial release. [cekk]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rer.voltoplugin.search-1.0.2.tar.gz.
File metadata
- Download URL: rer.voltoplugin.search-1.0.2.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bebaa83e1051fac878b2127e5d73991072f2bb2d75f4816aed13041b8257f0ca
|
|
| MD5 |
ffce876ac99b92339a83baf0b738d34c
|
|
| BLAKE2b-256 |
2bcfc53eb71fe79bc163e53b9a74b3eafa8eb9e7c86eb4dcf7624afa213eb2c1
|
File details
Details for the file rer.voltoplugin.search-1.0.2-py3-none-any.whl.
File metadata
- Download URL: rer.voltoplugin.search-1.0.2-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee0eec344e24ed20b610640fbd9363e1a33d13e69bc81462118ba0dedd7ee2af
|
|
| MD5 |
635562cd660ed93114db2fcf7dff6ebc
|
|
| BLAKE2b-256 |
97be9d40a5fe313658ae7ee402d9954e4663165d894aa9690471b7413f8c78dd
|