Solr for newbies workshop

Categories:

Recommended

What is Solr

Solr is an open source search engine developed by the Apache Software Foundation. On its home page Solr advertises itself as

Solr is the popular, blazing-fast,
open source enterprise search platform built on Apache Lucene.

and the book Solr in Action describes Solr as

Solr is a scalable, ready-to-deploy enterprise search engine that’s optimized to search large volumes of text-centric data and return results sorted by relevance [p. 4]

The fact that Solr is a search engine means that there is a strong focus on speed, large volumes of text data, and the ability to sort the results by relevance.

Although Solr could technically be described as a NoSQL database (i.e. it allows us to store and retrieve data in a non-relational form) it is better to think of it as a search engine to emphasize the fact that it is better suited for text-centric and read-mostly environments [Solr in Action, p. 4].

What is Lucene

The core functionality that Solr makes available is provided by a Java library called Lucene. Lucene is the brain behind the “indexing and search technology, as well as spellchecking, hit highlighting and advanced analysis/tokenization capabilities” that we will see in this tutorial.

But Lucene is a Java Library than can only be used from other Java programs. Solr on the other hand is a wrapper around Lucene that allows us to use the Lucene functionality from any programming language that can submit HTTP requests.

In this diagram the client application could be a program written in Ruby or Python. In fact, as we will see throughout this tutorial, it can also be a system utility like cURL or a web browser. Anything that can submit HTTP requests can communicate with Solr.

Installing Solr for the first time

To install Solr we are going to use a tool called Docker that allows us to download small virtual machines (called containers) with pre-installed software. In our case we’ll download a container with Solr 9.1.0 installed on it and use that during the workshop.

NOTE: You can also download and install the Solr binaries directly on your machine without using Docker. You’ll need to have the Java Development Kit (JDK) for this to method to work. If you are interested in this approach take a look at these instructions instead.

For the Docker installation let’s start by going to https://www.docker.com/, download the “Docker Desktop”, install it, and run it.

Once installed run the following command from the terminal to make sure it’s running:

If Docker is not running we’ll see an error that will indicate something along the lines of

If we see this error it could be that the Docker Desktop app has not fully started. Wait a few seconds and try again. We can also open the “Docker Desktop” app and see its status.

Category:

Attribution

Hector Correa (1996), Solr for newbies workshop, URL: https://web.mit.edu/6.001/6.037/sicp.pdf

This work is licensed under the Attribution 4.0 International (CC BY 4.0):  (https://creativecommons.org/licenses/by/4.0/).

VP Flipbook Maker

Time to share your work in an interesting way! Visual Paradigm Online is a professional tool to do digital flipbook conversion and customization. Try it now and and display it to others!