Skip to content

Commit

Permalink
WIP port to using packages. Will require 8.7 release for full functio…
Browse files Browse the repository at this point in the history
…nality.

Also needs an updated wait-for-solr check to verify the packages have been installed before trying to create the collection.
  • Loading branch information
worleydl committed Sep 14, 2020
1 parent f23de5f commit 7bc3cb5
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- "8983:8983"
links:
- zookeeper
command: "bash -c '/opt/solr/bin/solr start -f -z zookeeper:2181 -Dbootstrap_confdir=/solr-config/index/conf'"
command: "bash -c './post-hooks.sh & /opt/solr/bin/solr start -f -z zookeeper:2181 -Denable.packages=true -Dbootstrap_confdir=/solr-config/index/conf'"

solr-proxy:
build: ./solr-proxy
Expand Down
3 changes: 2 additions & 1 deletion ocr/init/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# sleep 5
#done
#echo "Sleeping 15"
#sleep 15
sleep 15
./wait-for-solr.sh --max-attempts 10 --wait-seconds 4 --solr-url http://solr:8983
sleep 30

#echo "Uploading security.json to ZK"
#/opt/solr/server/scripts/cloud-scripts/zkcli.sh -zkhost zookeeper:2181 -cmd putfile /security.json /code/security.json
Expand Down
5 changes: 3 additions & 2 deletions solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM solr:8.5
FROM solr:8.6.2

# Add Tesseract
USER root
Expand All @@ -12,8 +12,9 @@ RUN mkdir -p /home/solr/ # Cache dir for fonts from Tika.
RUN chown -R 8983:8983 /home/solr

# Add Solr customizations
ADD lib/*.jar /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/
ADD web.xml /opt/solr/server/solr-webapp/webapp/WEB-INF
ADD post-hooks.sh /opt/solr
RUN chmod +x /opt/solr/post-hooks.sh

COPY solr-home /solr-config
ADD set_heap.sh /docker-entrypoint-initdb.db
Expand Down
Binary file not shown.
Binary file removed solr/lib/solr-payloads-1.0.3-solr7.1.0-SNAPSHOT.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions solr/post-hooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
wait-for-solr.sh --max-attempts 25 --wait-seconds 4 --solr-url http://solr:8983

bin/solr package add-repo osc https://raw.githubusercontent.com/o19s/payload-component/master/repo
bin/solr package install solr-payloads:1.1.4


6 changes: 3 additions & 3 deletions solr/solr-home/index/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
<fieldType name="ocr" stored="false" indexed="true" class="solr.TextField">
<analyzer>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="com.o19s.payloads.Base64Encoder" />
<filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="solr-payloads:com.o19s.payloads.Base64Encoder" />
<!-- The payload buffer works around WDF removing payloads from tokens by copying and replacing later in the chain -->
<filter class="com.o19s.payloads.filter.PayloadBufferFilterFactory" />
<filter class="solr-payloads:com.o19s.payloads.filter.PayloadBufferFilterFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.WordDelimiterFilterFactory" />
<filter class="solr.KStemFilterFactory" />
<filter class="com.o19s.payloads.filter.PayloadBufferFilterFactory" />
<filter class="solr-payloads:com.o19s.payloads.filter.PayloadBufferFilterFactory" />
</analyzer>
</fieldType>

Expand Down
6 changes: 3 additions & 3 deletions solr/solr-home/index/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
It is *not* a good example to work from.
-->
<config>
<luceneMatchVersion>7.1</luceneMatchVersion>
<luceneMatchVersion>8.6</luceneMatchVersion>

<lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
Expand Down Expand Up @@ -150,7 +150,7 @@
</admin>


<searchComponent class="com.o19s.payloads.component.PayloadComponent" name="payload" />
<searchComponent class="solr-payloads:com.o19s.payloads.component.PayloadComponent" name="payload" />
<!-- Highlighting Component
http://wiki.apache.org/solr/HighlightingParameters
Expand Down Expand Up @@ -185,7 +185,7 @@
<!-- Configure the standard formatter -->
<formatter name="html"
default="true"
class="com.o19s.labs.OffsetFormatter">
class="solr-payloads:com.o19s.hl.OffsetFormatter">
</formatter>

<!-- Configure the standard encoder -->
Expand Down

0 comments on commit 7bc3cb5

Please sign in to comment.