This chapter covers
- Designing your schema for indexing documents
- Defining fields and field types in schema.xml
- Using field types for structured data
- Handling update requests, commits, and atomic updates
- Managing index settings in solrconfig.xml
In chapter 3, we learned how Solr finds documents using an inverted index, which in its simplest form is a dictionary of terms and a list of documents in which each term occurs. Solr uses this index to match terms in a user’s query with the documents in which they occur. In this chapter, we’ll learn how Solr processes documents to build the index. A key factor in indexing documents is text analysis. In this chapter, we’ll focus on the indexing process and nontext fields, saving a detailed discussion of text analysis until chapter 6.
At the end of this chapter, you’ll know how to index documents in Solr and you’ll understand key concepts such as fields, field types, and schema design. As a prerequisite, this chapter will be easier to work through if you have the Solr example server running locally, which we covered in chapter 2. You’ll still be able to follow along with most examples without running Solr, if you prefer to read this chapter and then come back to do the hands-on activities.