05 December 2016

Apache Solr 6.3.0

Solr 6.3.0 

  • Download Apache Solr from : http://www.apache.org/dyn/closer.lua/lucene/solr/6.3.0
  • Download JDK 1.8 and higher and install 

Solr Terminologies 
Source: https://wiki.apache.org/solr/SolrTerminology

Collections are made up of one or more shards. Shards have one or more replicas. Each replica is a core. A single collection represents a single logical index.

A single search index.
SolrCloud introduces the concept of a collection, which extends the concept of a uniquely named, managed, and configured index to one that is split into shards and distributed across multiple servers

A logical section of a single collection (also called Slice). Sometimes people will talk about "Shard" in a physical sense (a manifestation of a logical shard)

A physical manifestation of a logical Shard, implemented as a single Lucene index on a SolrCore

One Replica of every Shard will be designated as a Leader to coordinate indexing for that Shard

Encapsulates a single physical index. One or more make up logical shards (or slices) which make up a collection. A Solr core is a uniquely named, managed, and configured index running in a Solr server; a Solr server can host one or more cores. A core is typically used to separate documents that have different schemas

A single instance of Solr. A single Solr instance can have multiple SolrCores that can be part of any number of collections.

All of the nodes you are using to host SolrCores.
So basically a Collection (Logical group) has multiple cores (physical indexes).

Starting Solr 

  • Set java home 

set JAVA_HOME="C:\Program Files (x86)\Java\jre1.8.0_112"

  • Stopping Solr 

$SOLR\bin\solr stop -all

  • Creating new Solr core 

start solr :
$SOLR\bin\solr start

Create core
$SOLR\bin\solr create_core -c mycore

Unload Core :

  • Quering to Solr 

Using UI :

Using URL

  • Adding document 

From UI we can add document

Using URL :

And send payload in post in following format

   <field name="authors_ss">Patrick Eagar</field>
   <field name="subject_s">Sports</field>
   <field name="dd_d">796.35</field>
   <field name="numpages_i">128</field>
   <field name="desc_t"></field>
   <field name="price_d">12.40</field>
   <field name="title_t" boost="2.0"> Summer of the all-rounder: Test and 
   championship cricket in England 1982 </field>
   <field name="isbn_s">0002166313</field>
   <field name="yearpub_i">1982</field>
   <field name="publisher_ss">Collins</field>

  • Delete record : 
  • From UI :

    Documents : <delete><query>*:*</query></delete>

    Using URL :
    in Payload send the query in following format :

    No comments:

    Post a Comment