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 the main grunt dist
process in the Splainer application that builds a complete webapp in the ../dist
directory. _This should be automated someday ;-( _.
- Copy the following Javascript and paste it at the bottom of
/dist/scripts/app.js
:
/* Override default config values for talking to Solr
* JSONP->GET
* */
angular.module('o19s.splainer-search')
.value('defaultSolrConfig', {
sanitize: true,
highlight: true,
debug: true,
numberOfRows: 10,
escapeQuery: true,
apiMethod: 'GET'
});
- 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/
python -m http.server
-
In a Run Solr and install the package:
tar -xf solr-9.3.0.tgz; cd solr-9.3.0/ bin/solr start -c -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.
- Changes communication with Solr to use GET instead af JSONP, same way the Admin UI communicates with Solr
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