CastleCMS and Plone integration with OpenSearch
This product was forked from collective.elasticsearch in order to provide integration with OpenSearch instead of ElasticSearch. OpenSearch itself is a fork of ElasticSearch and compatible with, at least, the ES 7.10.x series of releases (at least at opensearch-py 1.1.0). Compatibility may diverge in the future, and while the collective.elasticsearch package will likely try to maintain compatibility with ElasticSearch, wildcard.hps is intended to maintain compatibility with OpenSearch.
First, start up an instance (for official guides, see the opensearch project documentation)
$ docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" opensearchproject/opensearch:latest
$ curl -XGET https://localhost:9200 -u 'admin:admin' -k
Second, setup Plone/CastleCMS:
wildcard.hps
to the eggs
section of your buildoutConfiguration Settings are passed as environment variables. See the "Configuration" section below for more details.
This package aims to index all fields the portal_catalog
indexes
and allows you to delete the Title
, Description
and SearchableText
indexes which can provide significant improvement to performance and RAM usage.
OpenSearch queries are ONLY used when Title, Description and SearchableText text are in the query. Otherwise, Plone's default catalog will be used. This is because Plone's default catalog is faster on normal queries than using OpenSearch.
Configuration for OpenSearch connections, and custom index naming, is done through Environment Variables. This allows per-instance customization without the need to modify site data, and allows for many deployments to use the same cluster(s) without needing to do per-site customized index names.
Available Environrment Variable Options:
HPS_ZOPE_CONF_PATH
reindex_hps
script that gets installed.
See wildcard/hps/scripts/reindex.py
.HPS_OVERRIDE_LOGGING
reindex_hps
script to override the root logging
configuration, and print logging to console at INFO level.HPS_FORCE_ENABLE
HPS_INSTANCE_INDEX_PREFIX
HPS_INCLUDE_TRASHED_BY_DEFAULT
HPS_FOCE_EXTERNAL_INDEXES
OPENSEARCH_HOSTS
OPENSEARCH_HTTP_USERNAME
and OPENSEARCH_HTTP_PASSWORD
to pass
the same HTTP auth to each request to any node listed as a host.OPENSEARCH_HTTP_USERNAME
OPENSEARCH_HOSTS
listOPENSEARCH_HTTP_PASSWORD
OPENSEARCH_HOSTS
listOPENSEARCH_TIMEOUT
OPENSEARCH_RETRY_ON_TIMEOUT
OPENSEARCH_SNIFF_ON_START
OPENSEARCH_SNIFF_ON_CONNECTION_FAIL
OPENSEARCH_SNIFFER_TIMEOUT
OPENSEARCH_SNIFF_TIMEOUT
OPENSEARCH_USE_SSL
OPENSEARCH_VERIFY_CERTS
OPENSEARCH_SSL_SHOW_WARN
OPENSEARCH_CERTS_PATH
OPENSEARCH_CLIENT_CERT_PATH
OPENSEARCH_CLIENT_CERT_KEY
--
Only tested with Plone 5 with Dexterity types.
Only compatible with versions of OpenSearch (and ElasticSearch) compatible
with the opensearch-py
library.
For ElasticSearch integration, see collective.elasticsearch.
Support for all index column types is done EXCEPT for the DateRecurringIndex index column type. If you are doing a full text search along with a query that contains a DateRecurringIndex column, it will not work.
This package comes with Celery support where all indexing operations will be pushed into celery to be run asynchronously.
Please see instructions for collective.celery to see how this works.
First, start an instance of OpenSearch.
Second,
$ virtualenv ./env
$ ./env/bin/pip install -r requirements.txt
$ ./env/bin/buildout -c buildout.cfg
$ ./bin/test