Using the enumeration type

Imagine that we use Solr to store information about our environment's state, error, and events related to them—a simple solution that will work as a simple log centralization solution. For our simple use case, we will store the identifier of the message, the information, what type of event it is, and the severity of the event, showing us how important the event is. However, what we will want to be sure of is that the severity field contains only values from a given list. To achieve all this, we will use the Solr enumeration type.

How to do it...

To achieve our requirements, we will have to perform the following steps:

  1. We will start with the index structure. Our field list from the schema.xml file will look as follows:

Get Solr Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.