Skip to content

Latest commit

 

History

History
96 lines (61 loc) · 2.83 KB

File metadata and controls

96 lines (61 loc) · 2.83 KB

Splainer Solr Plugin

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.

Installing Into Solr

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

Building and installation

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 ;-( _.

  1. 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.

  1. With the solr-splainer-package directory:
cd ./solr-splainer-package
  1. Export the private key:
export SOLR_PACKAGE_SIGNING_PRIVATE_KEY_PATH=~/.ssh/solr-private-key.pem
  1. Build the package:
mvn package
  1. 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
  1. 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

  2. Navigate to http://localhost:8983/v2/splainer on the browser.

Who?

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!.

License

Released under Apache 2