Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/solrconfig_extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@
7.0.0
-->
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<lib dir="/var/solr/data/contrib/ocrhighlighting/lib" regex=".*\.jar" />
<lib dir="/opt/solr_extra_lib/ocrhighlighting/lib" regex=".*\.jar" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify jars are present and the class is loadable from the new location.

Ensure the directory exists in the runtime environment, Solr can read it, and it contains the plugin jars exporting solrocr.OcrHighlightComponent.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
DIR="/opt/solr_extra_lib/ocrhighlighting/lib"

# 1) Directory and permissions
test -d "$DIR" || { echo "Missing: $DIR"; exit 1; }
ls -l "$DIR"

# 2) Jars present
fd -e jar . "$DIR" | tee /tmp/ocr_jars.txt
test -s /tmp/ocr_jars.txt || { echo "No jars found in $DIR"; exit 1; }

# 3) Try to locate the component class in jars
while read -r J; do
  if jar tf "$J" | rg -q '^solrocr/OcrHighlightComponent.class$'; then
    echo "Found solrocr.OcrHighlightComponent in: $J"
    FOUND=1
  fi
done < /tmp/ocr_jars.txt
test "${FOUND:-0}" = 1 || { echo "Component class not found in provided jars"; exit 1; }

# 4) Optional: ensure Solr user can read
id solr >/dev/null 2>&1 && sudo -n -u solr bash -c "test -r '$DIR' && echo 'solr user can read $DIR'"

Length of output: 48


Ensure OCR lib directory exists and is populated
/opt/solr_extra_lib/ocrhighlighting/lib was not found in the environment (script reported “Missing: /opt/solr_extra_lib/ocrhighlighting/lib”). Solr will fail to load solrocr.OcrHighlightComponent unless that directory is created, populated with the plugin JARs, and readable by the Solr user.

🤖 Prompt for AI Agents
In conf/solrconfig_extra.xml around line 249, the <lib> entry points to
/opt/solr_extra_lib/ocrhighlighting/lib which is missing; create that directory,
place the required OCR plugin JARs (including the solrocr OcrHighlightComponent
JAR and its dependencies) into it, set ownership to the Solr user and
permissions to be readable by Solr (eg. chown solr:solr and chmod 0755 for dirs,
0644 for jars), and verify the files are present and readable before restarting
Solr so the component can be loaded.