From 7722c8348cce1ba86eff0932f923bb907064c0b9 Mon Sep 17 00:00:00 2001 From: Stefan Hardegger Date: Mon, 20 Jul 2026 11:49:52 +0200 Subject: [PATCH] solr fix --- backend/src/main/resources/application.yml | 1 + solr.Dockerfile | 5 ++ solr/collections/conf/managed-schema | 86 +++++++++++++++++++ solr/collections/conf/solrconfig.xml | 97 ++++++++++++++++++++++ solr/collections/conf/stopwords.txt | 34 ++++++++ solr/collections/conf/synonyms.txt | 9 ++ solr/stories/conf/managed-schema | 2 +- 7 files changed, 233 insertions(+), 1 deletion(-) create mode 100755 solr/collections/conf/managed-schema create mode 100755 solr/collections/conf/solrconfig.xml create mode 100755 solr/collections/conf/stopwords.txt create mode 100755 solr/collections/conf/synonyms.txt diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 53254ed..8525e23 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -63,6 +63,7 @@ storycove: cores: stories: ${SOLR_STORIES_CORE:storycove_stories} authors: ${SOLR_AUTHORS_CORE:storycove_authors} + collections: ${SOLR_COLLECTIONS_CORE:storycove_collections} # Connection settings connection: diff --git a/solr.Dockerfile b/solr.Dockerfile index a913412..6a5833a 100644 --- a/solr.Dockerfile +++ b/solr.Dockerfile @@ -6,6 +6,7 @@ USER root # Copy Solr configurations into the image COPY ./solr/stories /opt/solr-9.9.0/server/solr/configsets/storycove_stories COPY ./solr/authors /opt/solr-9.9.0/server/solr/configsets/storycove_authors +COPY ./solr/collections /opt/solr-9.9.0/server/solr/configsets/storycove_collections # Create initialization script using the precreate-core pattern COPY < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + diff --git a/solr/collections/conf/solrconfig.xml b/solr/collections/conf/solrconfig.xml new file mode 100755 index 0000000..68f5bf7 --- /dev/null +++ b/solr/collections/conf/solrconfig.xml @@ -0,0 +1,97 @@ + + + + 9.9.0 + + ${solr.data.dir:} + + + + + + + ${solr.lock.type:native} + true + + + + + + + ${solr.ulog.dir:} + ${solr.ulog.numVersionBuckets:65536} + + + + 15000 + false + + + + 1000 + + + + + 1024 + + + + true + + + + + + + + + + explicit + 10 + text + json + true + true + name,description + <em> + </em> + 150 + true + tagNames + isArchived + 1 + + + + + + + + *:* + + + all + + + + + application/json; charset=UTF-8 + + + diff --git a/solr/collections/conf/stopwords.txt b/solr/collections/conf/stopwords.txt new file mode 100755 index 0000000..431df9b --- /dev/null +++ b/solr/collections/conf/stopwords.txt @@ -0,0 +1,34 @@ +# English stopwords for author search +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +such +that +the +their +then +there +these +they +this +to +was +will +with \ No newline at end of file diff --git a/solr/collections/conf/synonyms.txt b/solr/collections/conf/synonyms.txt new file mode 100755 index 0000000..d782303 --- /dev/null +++ b/solr/collections/conf/synonyms.txt @@ -0,0 +1,9 @@ +# Synonyms for author search +# Format: word1,word2,word3 => synonym1,synonym2 +writer,author,novelist +pen name,pseudonym,alias +prolific,productive +acclaimed,famous,renowned +bestselling,popular +contemporary,modern +classic,traditional \ No newline at end of file diff --git a/solr/stories/conf/managed-schema b/solr/stories/conf/managed-schema index 5bba122..15826fe 100755 --- a/solr/stories/conf/managed-schema +++ b/solr/stories/conf/managed-schema @@ -78,7 +78,7 @@ - +