-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatibility: Solr v9.1.0 & Lucene v9.3.0
- Loading branch information
1 parent
1f6e7b5
commit 7fd9886
Showing
13 changed files
with
1,081 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# A few useful Docker commands to build an image and run the Solr container. | ||
# | ||
# Build (run with '--no-cache' to ensure that Git repo new tags will be pulled down, as Docker caches RUN layers): | ||
# docker build -t solr-sudachi . --progress=plain --no-cache | ||
# | ||
# Run: | ||
# docker run -p 8983:8983 --rm solr-sudachi:latest solr-precreate example | ||
# | ||
# cURL requests: | ||
# 1. curl -sS 'http://localhost:8983/solr/example/analysis/field?analysis.fieldtype=text_ja' --get --data-urlencode 'analysis.fieldvalue=ちいかわ' | jq '.analysis.field_types.text_ja.index[1][].text' | ||
# 2. curl -sS 'http://localhost:8983/solr/example/analysis/field?analysis.fieldtype=text_ja' --get --data-urlencode 'analysis.fieldvalue=すもももももももものうち' | jq '.analysis.field_types.text_ja.index[1][].text' | ||
# 3. curl -sS 'http://localhost:8983/solr/example/analysis/field?analysis.fieldtype=text_ja' --get --data-urlencode 'analysis.fieldvalue=聖川真斗' | jq '.analysis.field_types.text_ja.index[1][].text' | ||
# | ||
# See: https://github.com/apache/lucene/pull/12517 | ||
# | ||
|
||
######################################################################################## | ||
# Stage 1 : Solr Lucene Analyzer Sudachi JAR | ||
######################################################################################## | ||
FROM gradle:8.1.1-jdk11@sha256:681c18e70745546bf66949861d18019b979810ac151a5e0933d4ff83c76b4f5f AS BUILD_JAR_STAGE | ||
|
||
ARG PLUGIN_GIT_TAG=9.1.0 | ||
|
||
ENV GRADLE_USER_HOME=/home/gradle | ||
WORKDIR $GRADLE_USER_HOME | ||
|
||
RUN git clone -b v$PLUGIN_GIT_TAG https://github.com/azagniotov/solr-lucene-analyzer-sudachi.git --depth 1 && \ | ||
git config --global user.name "Alexander Zagniotov" && \ | ||
git config --global user.email "[email protected]" | ||
|
||
# Download the dictionary and assemble the JAR to be placed under Solr /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/ | ||
RUN cd solr-lucene-analyzer-sudachi && \ | ||
gradle configureDictionariesLocally && \ | ||
gradle -PsolrVersion=$PLUGIN_GIT_TAG assemble && \ | ||
ls -al ./build/libs/ | ||
|
||
|
||
######################################################################################## | ||
# Stage 2 : Run Solr | ||
######################################################################################## | ||
FROM solr:9.1.0@sha256:2377b0acf16c68b1c223cf685350584debc49dbc5950e0ddff82317be566cb79 | ||
|
||
MAINTAINER Alexander Zagniotov <[email protected]> | ||
|
||
ENV SOLR_JAVA_MEM="-Xms2g -Xmx2g" | ||
ENV SOLR_SERVER_HOME=/opt/solr/server | ||
ENV SUDACHI_DICT_HOME=/tmp/sudachi | ||
ENV SOLR_WEB_INF_LIB_HOME=$SOLR_SERVER_HOME/solr-webapp/webapp/WEB-INF/lib | ||
|
||
USER root | ||
|
||
# Removing existing Lucene Kuromoji JAR to avoid polluting the classpath with | ||
# Japanese analysis-related classes. Also, Lucene team has renamed the packages | ||
# from analyzers => analysis at some point, thus using a wildcard. | ||
# RUN rm $SOLR_WEB_INF_LIB_HOME/lucene-*-kuromoji-*.jar | ||
|
||
COPY --from=BUILD_JAR_STAGE $SUDACHI_DICT_HOME/system-dict/system_core.dic $SUDACHI_DICT_HOME/system-dict/system_core.dic | ||
COPY --from=BUILD_JAR_STAGE $SUDACHI_DICT_HOME/user_lexicon.dic $SUDACHI_DICT_HOME/user_lexicon.dic | ||
COPY --from=BUILD_JAR_STAGE /home/gradle/solr-lucene-analyzer-sudachi/build/libs/solr-lucene-analyzer-sudachi*.jar $SOLR_WEB_INF_LIB_HOME/ | ||
COPY schema.xml $SOLR_SERVER_HOME/solr/configsets/_default/conf/managed-schema.xml | ||
|
||
RUN chown -R solr:solr /tmp/sudachi | ||
|
||
USER solr |
Oops, something went wrong.