Skip to content

Commit

Permalink
Add missing solr 9 configuration directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaiter committed May 18, 2022
1 parent 17e29e2 commit d5c22ad
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 14]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
java-version: 11
- uses: actions/cache@v2
env:
cache-name: cache-maven-artifacts
Expand Down
18 changes: 13 additions & 5 deletions integration-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ SOLR_HOST="${SOLR_HOST:-localhost}"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SOLR7_VERSIONS="7.7 7.6 7.5"
SOLR8_VERSIONS="8.11 8.10 8.9 8.8 8.7 8.6 8.5 8.4 8.3 8.2 8.1 8.0"
SOLR9_VERSIONS="9.0.0"
SOLR9_VERSIONS="9.0"
SOLR78_PLUGIN_PATH=/tmp/solrocr-solr78

wait_for_solr() {
while [[ "$(curl -s -o /dev/null http://$SOLR_HOST:31337/solr/ocr/select -w '%{http_code}')" != "200" ]]; do
status="404"
while [[ "$status" != "200" ]]; do
set +e
status="$(curl -s -o /dev/null http://$SOLR_HOST:31337/solr/ocr/select -w '%{http_code}')"
if [[ "$status" == "500" ]]; then
docker logs $1
exit 1
fi
sleep 3;
done
set -e
}

create_solr78_jar() {
Expand Down Expand Up @@ -43,7 +51,7 @@ for version in $SOLR9_VERSIONS; do
-p "31337:8983" \
solr:$version \
solr-precreate ocr /opt/core-config > /dev/null 2>&1 & \
wait_for_solr
wait_for_solr "$container_name"
if ! python3 test.py; then
printf " !!!FAIL!!!\n"
docker logs
Expand All @@ -68,7 +76,7 @@ for version in $SOLR8_VERSIONS; do
-p "31337:8983" \
solr:$version \
solr-precreate ocr /opt/core-config > /dev/null 2>&1 & \
wait_for_solr
wait_for_solr "$container_name"
if ! python3 test.py; then
printf " !!!FAIL!!!\n"
docker logs
Expand All @@ -92,7 +100,7 @@ for version in $SOLR7_VERSIONS; do
-p "31337:8983" \
solr:$version \
solr-precreate ocr /opt/core-config > /dev/null 2>&1 & \
wait_for_solr
wait_for_solr "$container_name"
if ! python3 test.py; then
printf " !!!FAIL!!!\n"
docker logs
Expand Down
35 changes: 35 additions & 0 deletions integration-tests/solr/core/v9/schema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<schema name="coordinateHighlight" version="1.0">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldtype name="text_ocr" class="solr.TextField" storeOffsetsWithPositions="true" termVectors="true">
<analyzer type="index">
<charFilter class="de.digitalcollections.solrocr.lucene.filters.ExternalUtf8ContentFilterFactory" />
<charFilter class="de.digitalcollections.solrocr.lucene.filters.OcrCharFilterFactory" />
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldtype>
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory"/>
<filter class="solr.PorterStemFilterFactory"/>
</analyzer>
</fieldType>
</types>

<fields>
<field name="id" type="string" multiValued="false" indexed="true" stored="true" required="true" />
<field name="ocr_text" type="text_ocr" multiValued="false" indexed="true" stored="true" />
</fields>
<uniqueKey>id</uniqueKey>
</schema>
18 changes: 18 additions & 0 deletions integration-tests/solr/core/v9/solrconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<config>
<luceneMatchVersion>9.0</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<schemaFactory class="ClassicIndexSchemaFactory"/>

<lib dir="/var/solr/data/plugins" regex=".*\.jar" />

<searchComponent class="de.digitalcollections.solrocr.solr.OcrHighlightComponent"
name="ocrHighlight" />

<requestHandler name="/select" class="solr.SearchHandler">
<arr name="components">
<str>query</str>
<str>ocrHighlight</str>
<str>highlight</str>
</arr>
</requestHandler>
</config>

0 comments on commit d5c22ad

Please sign in to comment.