diff --git a/CHANGES.md b/CHANGES.md index 455f30b64..76421bba0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,10 @@ Changelog ========= -3.0.0b147 (unreleased) +3.1.0b1 (unreleased) ---------------------- -- Nothing changed yet. +- remove elasticsearch integration 3.0.0b146 (2024-10-17) diff --git a/README.rst b/README.rst index 4b8e45722..6b145c141 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ In addition to Plone standard features, CastleCMS includes: - Advanced content layout editor - Improved management toolbar - Intuitive content creation and organization -- Elasticsearch integration +- Opensearch integration - Search results tuned by social media impact - Search results pinning - Celery task queue integration (asynchronous actions) @@ -79,20 +79,20 @@ Dependencies - Redis - avconv (needs to be updated for ffmpeg again) -- ElasticSearch 2.3 +- Opensearch 1.1+ Development setup on macOS -------------------------- -1. ``brew install redis elasticsearch libav python`` +1. ``brew install redis opensearch libav python`` 2. ``git clone git@github.com:castlecms/castle.cms.git`` 3. ``cd castle.cms`` 4. ``virtualenv -p python2.7 .`` 5. ``bin/pip install --upgrade pip`` 6. ``bin/pip install -r requirements.txt`` 7. ``bin/buildout`` -8. Run (in separate terminal windows) ``elasticsearch``, ``redis-server``, ``bin/instance fg`` +8. Run (in separate terminal windows) ``opensearch``, ``redis-server``, ``bin/instance fg`` 9. Browse to http://localhost:8080/ Once you have created a site in the development instance: @@ -106,7 +106,6 @@ Optional Dependencies --------------------- - Install `argon2_cffi` to use more secure password hashing. -- https://github.com/castlecms/elasticsearch-castle-scoring - https://github.com/castlecms/castlehps for faster search integration - Amazon S3 credentials to store large files on S3 - Google API keys for Google analytics and Recaptcha integrations @@ -147,7 +146,7 @@ Running local dependencies with docker or, just the essentials: $ docker run -p 6379:6379 redis - $ docker run -p 9200:9200 elasticsearch:2.4-alpine + $ docker run -p 9200:9200 opensearchproject/opensearch:latest Forks/Custom releases diff --git a/buildout.cfg b/buildout.cfg index 5a03d9ad7..7ac634c28 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -10,7 +10,6 @@ auto-checkout = [sources] plone.app.mosaic = git git@github.com:castlecms/plone.app.mosaic.git branch=castlecms-5.0.x collective.celery = git git@github.com:collective/collective.celery.git branch=master -# collective.elasticsearch = git git@github.com:collective/collective.elasticsearch.git collective.documentviewer = git git@github.com:collective/collective.documentviewer.git branch=master castle.theme = git git@github.com:castlecms/castle.theme.git branch=master collective.easyform = git git@github.com:collective/collective.easyform.git diff --git a/castle/cms/cron/_social_counts.py b/castle/cms/cron/_social_counts.py index 19fe2becd..748cfddc4 100644 --- a/castle/cms/cron/_social_counts.py +++ b/castle/cms/cron/_social_counts.py @@ -10,7 +10,7 @@ from AccessControl.SecurityManagement import newSecurityManager from Acquisition import aq_parent from BTrees.OOBTree import OOBTree -from castle.cms.indexing.hps import index_in_es +# from castle.cms.indexing.hps import index_in_es from castle.cms.social import COUNT_ANNOTATION_KEY from castle.cms.utils import clear_object_cache, retriable from plone.app.redirector.interfaces import IRedirectionStorage @@ -214,7 +214,7 @@ def get_social_counts(site, obj, site_url, count_types, count=0): transaction.commit() - index_in_es(obj) + # index_in_es(obj) if count % 200 == 0: clear_object_cache(site) diff --git a/castle/cms/cron/_twitter_monitor.py b/castle/cms/cron/_twitter_monitor.py index 5a585dde0..8d5948de7 100644 --- a/castle/cms/cron/_twitter_monitor.py +++ b/castle/cms/cron/_twitter_monitor.py @@ -1,6 +1,6 @@ from AccessControl.SecurityManagement import newSecurityManager from BTrees.OOBTree import OOBTree -from castle.cms.indexing.hps import index_in_es +# from castle.cms.indexing.hps import index_in_es from castle.cms.services import twitter from castle.cms.social import COUNT_ANNOTATION_KEY from castle.cms.utils import retriable @@ -82,7 +82,9 @@ def parse_line(site, public_url, line): record_tweet_stats(site, ob, tweet) if modified: transaction.commit() - index_in_es() + # this method is supposed to get an 'obj' as a parameter, so I'm not confident this + # was working before we removed ES + # index_in_es() class StreamListener(twitter.StreamListener): diff --git a/castle/cms/indexing/hps.py b/castle/cms/indexing/hps.py index f457b3379..6bbeaea9d 100644 --- a/castle/cms/indexing/hps.py +++ b/castle/cms/indexing/hps.py @@ -12,8 +12,6 @@ from wildcard.hps.opensearch import WildcardHPSCatalog from zope.component import getMultiAdapter from zope.component import getUtility -from collective.elasticsearch.es import ElasticSearchCatalog -from collective.elasticsearch.hook import index_batch logger = logging.getLogger("Plone") @@ -158,13 +156,6 @@ def gen_audit_query( return query -def index_in_es(obj): - catalog = api.portal.get_tool('portal_catalog') - es = ElasticSearchCatalog(catalog) - if es.enabled: - index_batch([], {IUUID(obj): obj}, [], es) - - def get_index_summary(index_name, terms, agg_agg_terms=None, filter_terms=None): query = { "size": 0, diff --git a/castle/cms/interfaces/layers.py b/castle/cms/interfaces/layers.py index 21cf0b631..9b0c1807e 100644 --- a/castle/cms/interfaces/layers.py +++ b/castle/cms/interfaces/layers.py @@ -1,9 +1,3 @@ -# IElasticSearchLayer ensures that if collective.elasticsearch is installed -# as an addon in a site, that the "search" view is overridden correctly by castle.cms -# this should be considered deprecated behavior, and will be removed in a -# future release. -from collective.elasticsearch.interfaces import IElasticSearchLayer - from plone.app.contenttypes.interfaces import IPloneAppContenttypesLayer from plone.app.mosaic.interfaces import IMosaicLayer from plone.app.tiles.interfaces import ITilesFormLayer @@ -17,7 +11,6 @@ class ICastleLayer( IMosaicLayer, ITilesFormLayer, IPloneAppContenttypesLayer, - IElasticSearchLayer, # included to ensure compatibility, see note by import IWildcardHPSLayer): pass diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 0df764e67..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,38 +0,0 @@ - -version: '3' -services: - redis: - image: "redis:alpine" - ports: - - 6379:6379 - elasticsearch: - image: "elasticsearch:7.6.0" - ports: - - 9200:9200 - environment: - - node.name=es01 - - discovery.type=single-node - networks: - - elastic - kibana: - image: "docker.elastic.co/kibana/kibana:7.6.0" - container_name: "kibana" - ports: - - 5601:5601 - environment: - ELASTICSEARCH_URL: http://elasticsearch:9200 - ELASTICSEARCH_HOSTS: http://elasticsearch:9200 - networks: - - elastic - etherpad: - image: "etherpad/etherpad" - ports: - - 9001:9001 - mail: - image: "mailhog/mailhog" - ports: - - 1025:1025 - - 8025:8025 -networks: - elastic: - driver: bridge diff --git a/setup.py b/setup.py index e883e903c..0edc90c73 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ def read(*rnames): name='castle.cms', description='CastleCMS Plone distribution main package', long_description_content_type='text/x-rst', - version='3.0.0b147.dev0', + version='3.1.0b1.dev0', long_description='%s\n%s' % ( read('README.rst'), read('CHANGES.md') @@ -66,10 +66,6 @@ def read(*rnames): 'wildcard.hps>=1.4.0', 'collective.celery>=1.1.4', - # the use of collective.elasticsearch in the 3.x+ version of castle.cms - # is limited and should not be relied on. - 'collective.elasticsearch >=4.0.0, <5.0.0', - # python 'boto3>=1.9.222', 'google-api-python-client >=1.4.2, <2', diff --git a/versions.cfg b/versions.cfg index faad16575..8a059c190 100644 --- a/versions.cfg +++ b/versions.cfg @@ -49,7 +49,6 @@ Products.ATContentTypes = 2.2.14+wc.1 # addons collective.celery = 1.1.4 -collective.elasticsearch = 4.0.0 collective.documentviewer = 5.0.4 wildcard.readonly = 1.0 repoze.catalog = 0.8.3 @@ -66,7 +65,6 @@ anyjson = 0.3.3 billiard = 3.5.0.4 cachetools = 2.0.0 celery = 4.2.1 -elasticsearch = 7.6.0 kombu = 4.2.1 urllib3 = 1.25.3 plone.formwidget.multifile = 1.1