Book Image

Solr Cookbook - Third Edition

By : Rafal Kuc
Book Image

Solr Cookbook - Third Edition

By: Rafal Kuc

Overview of this book

Table of Contents (18 chapters)
Solr Cookbook Third Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Altering the index structure on a live collection


The ability to push a new index structure definition (the schema.xml file) to ZooKeeper is nice, but it requires the collection to be reloaded. The same goes for Solr, when it works in noncloud mode, we need to reload a core for Solr to see the changes. This is also not super convenient when you would like to change the index structure from outside Solr. That is why with the release of Solr 4.3, the Schema API allows you to alter the index structure using simple HTTP-based requests. In this recipe, we will take a look at how to use the Schema API to alter our index structure.

Getting ready

Before continuing with the recipe, read the Retrieving information about the index structure recipe discussed earlier in this chapter, as it provides information on how to read index structure information using Solr Schema API.

How to do it...

For the purpose of this recipe, let's assume that we have a very basic index structure that we want to add a field...