From dc347958c38d160328365d67e22185461e512789 Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 29 Oct 2021 13:58:53 +0200 Subject: [PATCH] commit solr directory changes --- Dockerfile | 42 ++++-- solrconfig-2.9.3.xml | 345 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 377 insertions(+), 10 deletions(-) create mode 100644 solrconfig-2.9.3.xml diff --git a/Dockerfile b/Dockerfile index 4a74f83..a29437d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,35 @@ -FROM postgres:12-alpine +FROM solr:6.6.6 -# Allow connections; we don't map out any ports so only linked docker containers can connect -RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf +# Enviroment variables +ENV SOLR_CORE ckan -# Customize default user/pass/db -ENV POSTGRES_DB ckan -ENV POSTGRES_USER ckan -ARG POSTGRES_PASSWORD -ARG DATASTORE_READONLY_PASSWORD +# Build Arguments +ARG CKAN_VERSION +ARG SOLR_VERSION -# Include datastore setup scripts -COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d \ No newline at end of file +# root user for initial config +USER root + +# Create directories +RUN mkdir -p /opt/solr/server/solr/${SOLR_CORE}/conf && \ + mkdir -p /opt/solr/server/solr/${SOLR_CORE}/data && \ + mkdir -p /opt/solr/server/solr/${SOLR_CORE}/data/index + +# Add files +COPY ./solr/solrconfig-${CKAN_VERSION}.xml /opt/solr/server/solr/${SOLR_CORE}/conf/solrconfig.xml +ADD https://raw.githubusercontent.com/ckan/ckan/ckan-${CKAN_VERSION}/ckan/config/solr/schema.xml \ +https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/currency.xml \ +https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/synonyms.txt \ +https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/stopwords.txt \ +https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/basic_configs/conf/protwords.txt \ +https://raw.githubusercontent.com/apache/lucene-solr/releases/lucene-solr/${SOLR_VERSION}/solr/server/solr/configsets/data_driven_schema_configs/conf/elevate.xml \ +/opt/solr/server/solr/${SOLR_CORE}/conf/ + +# Create core.properties +RUN echo name=${SOLR_CORE} > /opt/solr/server/solr/${SOLR_CORE}/core.properties + +# Giving ownership to Solr +RUN chown -R ${SOLR_USER}:${SOLR_USER} /opt/solr/server/solr/${SOLR_CORE} + +# non-root user for runtime +USER ${SOLR_USER}:${SOLR_USER} \ No newline at end of file diff --git a/solrconfig-2.9.3.xml b/solrconfig-2.9.3.xml new file mode 100644 index 0000000..5ddc4c4 --- /dev/null +++ b/solrconfig-2.9.3.xml @@ -0,0 +1,345 @@ + + + + + + 6.0.0 + + + + + + + + + + + ${solr.data.dir:} + + + + + + + ${solr.lock.type:native} + + + + + + + + ${solr.ulog.dir:} + ${solr.ulog.numVersionBuckets:65536} + + + + ${solr.autoCommit.maxTime:15000} + false + + + + ${solr.autoSoftCommit.maxTime:-1} + + + + + + + 1024 + + + + + true + 20 + 200 + + + + + + + + + + false + 2 + + + + + + + + + + + + + + explicit + 10 + + + + + + + + explicit + json + true + + + + + + + + explicit + + + + + + + + _text_ + + + + + + + + add-unknown-fields-to-the-schema + + + + + + + + true + ignored_ + _text_ + + + + + + + + + + + explicit + true + + + + + + + text_general + + + default + _text_ + solr.DirectSolrSpellChecker + internal + 0.5 + 2 + 1 + 5 + 4 + 0.01 + + + + + + + + default + on + true + 10 + 5 + 5 + true + true + 10 + 5 + + + + spellcheck + + + + + + + + + + true + + + tvComponent + + + + + + + + + + true + false + + + + terms + + + + + + + string + elevate.xml + + + + + + + explicit + + + elevator + + + + + + + + + + + 100 + + + + + + 70 + 0.5 + [-\w ,/\n\"']{20,200} + + + + + + ]]> + ]]> + + + + + + + + + + + + ,, + ,, + ,, + ,, + ,]]> + ]]> + + + + + + + 10 + .,!? + + + + + + WORD + en + US + + + + + + + + + true + + + + + + + + + [^\w-\.] + _ + + + + + + + yyyy-MM-dd'T'HH:mm:ss.SSSZ + yyyy-MM-dd'T'HH:mm:ss,SSSZ + yyyy-MM-dd'T'HH:mm:ss.SSS + yyyy-MM-dd'T'HH:mm:ss,SSS + yyyy-MM-dd'T'HH:mm:ssZ + yyyy-MM-dd'T'HH:mm:ss + yyyy-MM-dd'T'HH:mmZ + yyyy-MM-dd'T'HH:mm + yyyy-MM-dd HH:mm:ss.SSSZ + yyyy-MM-dd HH:mm:ss,SSSZ + yyyy-MM-dd HH:mm:ss.SSS + yyyy-MM-dd HH:mm:ss,SSS + yyyy-MM-dd HH:mm:ssZ + yyyy-MM-dd HH:mm:ss + yyyy-MM-dd HH:mmZ + yyyy-MM-dd HH:mm + yyyy-MM-dd + + + + + + + text/plain; charset=UTF-8 + + + + ${velocity.template.base.dir:} + ${velocity.solr.resource.loader.enabled:true} + ${velocity.params.resource.loader.enabled:false} + + + + 5 + + + \ No newline at end of file