Here is the quick start to bring up a generic solr search engine.
Quick Guide on installing and creating a core using Solr command.
- Download Apache Solr
- 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.
Linux:tar -xvf solar-?.?.tar
Windows:
winzip to unzip solar-?.?.tar
- Do a quick test by starting the solr by
bin/solr start
- check in your browser; normal1ly it is running on http://localhost:8983
- Now fun begins - lets create core
- 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 - Open the Solr Dashboard, Click on "core selector" where you will see your core
- 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:- To create a new core/collection form existing core, first identify your core
- 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
- stop and start the solr instance
- Open the Solr Dashboard, Click on "core selector" where you will see your core
Solr start and stop commands.
- Start the solr by
bin/solr start
- shutdown your solr
bin/solr stop
Happy Searching and Indexing!!!!!