Skip to content

Commit

Permalink
example configuration (mapping, analysis)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed Feb 2, 2024
1 parent 4e659c4 commit 3bc7db2
Show file tree
Hide file tree
Showing 10 changed files with 1,340 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ The block is prepared for Matomo analytics.

# Getting started

You have OpenSearch or ElasticSearch up and running.

Install Plone backend add-on [`collective.elastic.plone 2.x`](https://github.com/collective/collective.elastic.plone) to provide the Plone REST API service which accepts queries and requests OpenSearch/ElasticSearch.

Install Plone backend add-on [`collective.elastic.ingest 2.x`](https://github.com/collective/collective.elastic.ingest) to index Plone content.

Setting up OpenSearch/ElasticSearch instructions can be found on [`collective.elastic.plone 2.x`](https://github.com/collective/collective.elastic.plone).
See the [example](example_configuration_opensearch) configuration of collective.elastic of a mapping, attachment handling and last but not least analysis.


# Configuration

Expand Down
2 changes: 2 additions & 0 deletions example_configuration_opensearch/dev-opensearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM opensearchproject/opensearch:latest
RUN /usr/share/opensearch/bin/opensearch-plugin install --batch ingest-attachment
4 changes: 4 additions & 0 deletions example_configuration_opensearch/dev-opensearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
See OpenSearch with Docker Compose https://github.com/collective/collective.elastic.ingest/tree/fd87bea1d11a97ae231a824aa3a0c145988faede#opensearch-with-docker-compose

docker buildx use default
docker buildx build --tag opensearch-ingest-attachment:latest .
99 changes: 99 additions & 0 deletions example_configuration_opensearch/dev-opensearch/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# opensearch needs sysctl -w vm.max_map_count=262144
# see https://stackoverflow.com/questions/66444027/max-virtual-memory-areas-vm-max-map-count-65530-is-too-low-increase-to-at-lea
version: '3'
services:

ingest:
image: ghcr.io/collective/collective.elastic.ingest:latest
environment:
MAPPINGS_FILE: ${MAPPINGS_FILE}
ANALYSIS_FILE: ${ANALYSIS_FILE}
PREPROCESSINGS_FILE: ${PREPROCESSINGS_FILE}
INDEX_SERVER: ${INDEX_SERVER?unset}
INDEX_USE_SSL: ${INDEX_USE_SSL?unset}
INDEX_OPENSEARCH: ${INDEX_OPENSEARCH?unset}
INDEX_LOGIN: ${INDEX_LOGIN?unset}
INDEX_PASSWORD: ${INDEX_PASSWORD?unset}
CELERY_BROKER: ${CELERY_BROKER?unset}
CELERY_CONCURRENCY: ${CELERY_CONCURRENCY:-1}
CELEREY_LOG_LEVEL: ${CELERY_LOG_LEVEL:-info}
PLONE_SERVICE: ${PLONE_SERVICE?unset}
PLONE_SITE_PREFIX_PATH: ${PLONE_SITE_PREFIX_PATH?unset}
PLONE_USER: ${PLONE_USER?unset}
PLONE_PASSWORD: ${PLONE_PASSWORD?unset}
SENTRY_DSN: ${SENTRY_DSN}
volumes:
- ingest-configuration:/configuration
networks:
- opensearch-net

redis:
image: 'redis:latest'
networks:
- opensearch-net
ports:
- 6379:6379

opensearch:
image: opensearch-ingest-attachment:latest # Specifying the freshly build local image
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch
- discovery.type=single-node
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx2g"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data:/usr/share/opensearch/data
- "./opensearch-configuration/keywords.txt:/usr/share/opensearch/config/keywords.txt"
- "./opensearch-configuration/lexicon.txt:/usr/share/opensearch/config/lexicon.txt"
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
networks:
- opensearch-net

opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:latest
ports:
- 5601:5601
expose:
- "5601"
environment:
OPENSEARCH_HOSTS: '["https://opensearch:9200"]'
networks:
- opensearch-net

dejavu:
image: appbaseio/dejavu:latest
container_name: dejavu
ports:
- "1358:1358"
expose:
- "1358"
links:
- opensearch

volumes:
opensearch-data:
ingest-configuration:
driver: local
driver_opts:
type: none
device: ./ingest-configuration
o: bind
# opensearch-configuration:
# driver: local
# driver_opts:
# type: none
# device: ./opensearch-configuration
# o: bind
networks:
opensearch-net:

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"settings": {
"analysis": {
"analyzer": {
"german_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"custom_dictionary_decompounder",
"no_stem",
"light_german_stemmer"
]
},
"german_exact_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase"
]
}
},
"filter": {
"custom_dictionary_decompounder": {
"type": "dictionary_decompounder",
"word_list_path": "lexicon.txt"
},
"no_stem": {
"type": "keyword_marker",
"keywords_path": "keywords.txt"
},
"light_german_stemmer": {
"type": "stemmer",
"language": "light_german"
}
}
}
}
}
Loading

0 comments on commit 3bc7db2

Please sign in to comment.