Skip to content

Commit

Permalink
Use Solr packages for o19s payload-component
Browse files Browse the repository at this point in the history
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 authored and risdenk committed Jan 26, 2022
1 parent 28a79f3 commit ae657c0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- ./volumes/solr_backup:/solr_backup
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"

Expand Down
3 changes: 2 additions & 1 deletion solr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -67,13 +67,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
4 changes: 2 additions & 2 deletions solr/solr-home/index/conf/solrconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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 @@ -169,7 +169,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 ae657c0

Please sign in to comment.