-
Notifications
You must be signed in to change notification settings - Fork 0
SUP-6848: Updating new ocrhighlighting path #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughUpdated Solr OCR highlighting library path in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
conf/solrconfig_extra.xml (2)
249-249: Avoid hard-coding the lib path; make it configurable via a system property.Using a property allows per-environment overrides without code changes.
-<lib dir="/opt/solr_extra_lib/ocrhighlighting/lib" regex=".*\.jar" /> +<lib dir="${solr.ocrhighlighting.lib:/opt/solr_extra_lib/ocrhighlighting/lib}" regex=".*\.jar" />
243-249: Consider using sharedLib if multiple cores need the same OCR plugin.If several cores use OCR highlighting, centralize jars via solr.xml sharedLib to avoid per-core duplication and classpath drift.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
conf/solrconfig_extra.xml(1 hunks)
conf/solrconfig_extra.xml
Outdated
| --> | ||
| <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" /> |
There was a problem hiding this comment.
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.
Summary by CodeRabbit