Apache Solr Primer – Quick Start Guide

Here is the quick start to bring up a generic solr search engine.

Quick Guide on installing and creating a core using Solr command.

  1. Download Apache Solr
  2. Install it in your favorite directory. Note it is really easy with Linux/Mac as you can just download tar file and untar it and you are in business.

     tar -xvf solar-?.?.tar


     winzip to unzip solar-?.?.tar 
  3. Do a quick test by starting the solr by
     bin/solr start 
  4. check in your browser; normal1ly it is running on http://localhost:8983
  5. Now fun begins - lets create core
  6. First - you will need to create a "core" which is similar to database schema. When indexing, you will identify by core for where the data should be index. Similarly, you will identify core for search query. Simplest way to create a new core is by following command in running Solr instance:
     ./bin/solr create -c example-core -s 1 -rf 1 
     options are 
    -c : name of the core
    -s : this sets number of the shards for the core. 
          This applies only when running in cloud mode. 
     -rf : number of copies of each document in each collection
  7. Open the Solr Dashboard, Click on "core selector" where you will see your core
  8. Solr with your core is ready for the indexing

Create more core from existing core

Once you have your core created, you can either use the solr command line to create another core or you can do the following:
  1. To create a new core/collection form existing core, first identify your core
  2. copy whole core folder to new directory at the sample level in Solr 7.x distribution it is #SOLR_HOME/server/solr .
    cd #SOLR_HOME/server/solr 
    cp -r  
  3. stop and start the solr instance
  4. Open the Solr Dashboard, Click on "core selector" where you will see your core

Solr start and stop commands.

  1. Start the solr by
     bin/solr start 
  2. shutdown your solr
     bin/solr stop 

Happy Searching and Indexing!!!!!