Make delicious recipes!

Introduction to Solr


Solr is a high performance search engine developed over the Lucene library.
It has several out-of-the-box features which can be made up and running quickly:
  1. Auto-completion

  2. Spell-checker

  3. Hit highlighting

  4. Geo spatial indexing (searching and ranking documents by latitude/longitude)

  5. Indexing of geographical shapes such as polygons

  6. Integrates with Apache Tika to support various document formats like pdf and word

  7. Optimistic locking is supported out of the box (locking using compare-and-swap)

  8. Durable writes - Meaning document is available in real-time for get requests even before its indexed.
    This is achieved by having a layer of transaction log between client and Lucene index.
    Get requests are serviced from this layer making get real-time even though the doc is not indexed.

  9. Automatic sharding and replication with Apache Zookeeper


Since 4.0, Solr provides a cloud-mode out of the box which takes care of sharding, replication, load-balancing and scales linearly.
This is referred to as Solr Cloud


When not to use Solr


Solr (or in general a search engine) is not good when:
  1. A query returns thousands of documents (like bootstrapping another Solr by querying current Solr)
    Because search engines store fields on disk in a format from which it is easy to get only a few documents, not millions.

  2. Lot of hierarchical relations are expected in the design with same kind of queries.

  3. Document-level security is desired in Solr.

  4. Building a very very large scale index.
    1. Solr is not recommended for very large scale inverted indexes like web-scale inverted index used in Google.
    2. For such cases, better use Hadoop map-reduce to create indexes.
    3. Apache Nutch is one such project that uses Hadoop to map-reduce web-links and feeding the resulting index to Solr.







Like us on Facebook to remain in touch
with the latest in technology and tutorials!


Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Name:
Email: (Your email is not shared with anybody)
Comment:

Facebook comments:

Site Owner: Sachin Goyal