Skip to content

Latest commit

 

History

History
74 lines (50 loc) · 2.65 KB

Installation.md

File metadata and controls

74 lines (50 loc) · 2.65 KB

Solr and Corona Installation

Prerequisites

1. Install Solr

Note: If you also want to index your sql database to solr, you can either rely on corona.index ns and use your favorite clojure sql library to fetch data to index (recommended), or use the Solr Data Importer plugin in which case you'll need extra installation steps: https://github.com/Stylitics/corona/blob/master/doc/Data-Import.md

2. set SOLR_HOME env var to point to solr home dir

For this library to work properly, you need to set SOLR_HOME var pointing to solr home folder you just installed.

For MAC users: You can put the following in your ~/.bash_profile file source ./.profile Then, put the following in your ~/.profile file

#Solr
export SOLR_HOME="$HOME/solr-8.0.0" # put right version here
export SOLR_ULIMIT_CHECKS=false

For Emacs users:

(setenv "SOLR_HOME" "/my/path/to/solr/home")
(setenv "SOLR_ULIMIT_CHECKS" "false")

3. Add corona library in project.clj

Clojars Project

4. Add Solr resources to your project

You can either:

NOTE: If you start from existing example, make sure, in your $CLJ_PROJECT_HOME/resources/solr/<core-name>/conf/solrconfig.xml file contains right maching lucene version <luceneMatchVersion>8.0.0</luceneMatchVersion>

5. Test solr

From command line

  • $ $SOLR_HOME/bin/solr start -p 8983
  • access Solr admin from your browser: http://localhost:8983/solr/
  • $ $SOLR_HOME/bin/solr stop -p 8983

From clojure

For development, you can start solr from Clojure repl.

  • make sure you are seeing SOLR_HOME variable. (System/getenv "SOLR_HOME")

  • then:

(require '[corona.cmd :as cmd])
(cmd/exec! :start) ;; $SOLR_HOME/bin/solr start