On 8/3/2018 9:09 AM, Joe Lerner wrote: > We recently set up Solr 7.4 in Production. There are 2 Solr nodes, with 3 > zookeepers. We need to make a schema change. What I want to do is simply > push the updated schema to Solr, and then re-index all the content to pick > up the change. But I am being told that I need to: > > 1. Delete the collection that depends on this config-set. > 2. Reload the config-set > 3. Recreate the dependent collection > > It seems to me that between steps #1 and #3, users will not be able to > search, which is not cool.
Here's a procedure that should work for most situations: 1. Upload a new configset to ZooKeeper. 2. Create a new collection using the new configset. 3. Index data into the new collection. 4. Set up an alias with the original collection name, pointing at the new collection. 5. When you're sure it's good, delete the old collection. Step 4 redirects requests to the original collection name so they end up on the collection. ======== Whether you need to delete the data before reindexing into the same collection depends on the precise nature of the change to your schema. Some schema changes require not only deleting all data in the collection, but actually deleting the entire index directory in every shard replica to remove all traces of the old data. Can you give precise details about what change you are planning to the schema? If you can be absolutely sure that there are no commits happening with openSearcher set to true and your schema change is safe for the existing index, then you can use the following procedure. Note that if anything goes wrong or the wrong kind of commit occurs during this, your users will be searching incomplete data: 1. Change the schema. 2. Reload the collection. 3. Delete all documents. 4. Index your data. 5. Issue a commit to make the changes visible. Thanks, Shawn