This project lets you install Splainer into your Solr as a plugin. You can access it via http://localhost:8983/v2/splainer and avoids common CORS and other network problems that you might encounter using the hosted http://splainer.io site.
bin/solr start -c -Denable.packages=true
bin/solr package add-repo splainer "https://raw.githubusercontent.com/o19s/splainer/main/solr-splainer-package/repo/"
bin/solr package list-available
bin/solr package install solr-splainer
bin/solr package deploy solr-splainer -y -cluster
This plugin requires a manual custom step added after you run yarn build in the Splainer application root, which produces a complete webapp in the ../dist directory. _This should be automated someday ;-( _.
- Configure Splainer to use GET instead of JSONP for Solr connections:
To change the API method from JSONP to GET:
Edit node_modules/splainer-search/values/defaultSolrConfig.js in the Splainer project (after yarn install) and adjust the defaultSolrConfig object, before you run yarn build. Vite bundles splainer-search into the app output; that file is not present as a separate copy under dist/.
Search for values/defaultSolrConfig.js.
Change:
apiMethod: "JSONP"to:
apiMethod: "GET"This change ensures Splainer communicates with Solr using GET requests (same as the Solr Admin UI) instead of JSONP, which is the appropriate method when Splainer is running as a plugin inside Solr.
- With the
solr-splainer-packagedirectory:
cd ./solr-splainer-package
- Export the private key:
export SOLR_PACKAGE_SIGNING_PRIVATE_KEY_PATH=~/.ssh/solr-private-key.pem
- Build the package:
mvn package
- Now for testing, host the solr-splainer-package/repo locally:
First copy the generated jar into the repo directory:
cp target/solr-splainer-package* repo/
And then serve them up:
python -m http.server
-
In a Run Solr and install the package:
tar -xf solr-10.0.0.tgz; cd solr-10.0.0/ bin/solr start -e films -Denable.packages=true bin/solr package add-repo splainer-dev "http://localhost:8000/repo/" bin/solr package list-available bin/solr package install solr-splainer bin/solr package deploy solr-splainer -y -cluster
-
Navigate to http://localhost:8983/v2/splainer on the browser.
Based on Another Hack by Doug Turnbull https://github.com/softwaredoug/solr-splainer. This works if you can't use Solr Packages in your environment.
Created by OpenSource Connections.
Thanks to all the community contributors for finding bugs and sharing fixes!.
Released under Apache 2