Solr 7 Migration
Helpful Links
- https://lucene.apache.org/solr/guide/7_2/major-changes-from-solr-5-to-solr-6.html#major-changes-from-solr-5-to-solr-6
- https://lucene.apache.org/solr/guide/6_6/upgrading-solr.html
- https://lucene.apache.org/solr/guide/7_3/solr-upgrade-notes.html
- https://lucene.apache.org/solr/guide/7_3/major-changes-in-solr-7.html#major-changes-in-solr-7
Solrj API changes
- Creating a collection
- Was:
new CollectionAdminRequest.Create().setCollectionName(collectionName).setNumShards(numShards).setConfigName(solrConfigName)
- Now:
CollectionAdminRequest.create(collectionName, solrConfigName, numShards, numReplicas)
- Was:
- Creating a collection alias
- Was:
new CollectionAdminRequest.CreateAlias().setAliasName(reindex.getDefaultCollection()).setAliasedCollections(collectionName)
- Now:
CollectionAdminRequest.createAlias(aliasName, collectionName)
- Was:
- Creating collection reload
- Was:
new CollectionAdminRequest.Reload().setCollectionName(collectionName);
- Now:
CollectionAdminRequest.reloadCollection(collectionName);
- Was:
CloudSolrClient#getZkStateReader().getClusterState().getCollections()
has been removed- Methods available as replacement:
ClusterState#hasCollection
,ClusterState#getCollectionsMap
,ClusterState#getCollectionStates
, andClusterState#getCollectionOrNull
- Methods available as replacement:
- CloudSolrClient contructors changed
- Now it takes a CloudSolrClient#Builder object
- GenericSolrRequest api change
- Was: Set content using
GenericSolrRequest#setContentStreams
- Now: Set content using
GenericSolrRequest#setContentWriter
- Was: Set content using
Solr config changes
- All Trie fields now Point fields
- precisionStep has been removed
- solr.WordDelimiterFilterFactory now solr.WordDelimiterGraphFilterFactory
- solr.SynonymFilterFactory now solr.SynonymGraphFilterFactory
- solr.ManagedSynonymFilterFactory now solr.ManagedSynonymGraphFilterFactory
- All graph filter factories used in indexing must be followed by solr.FlattenGraphFilterFactory in the index analyzer
Migration
- Migrating your Solr server is not required but it is advised since there's no guarantee that all Solrj 7 APIs will communicate correctly with a Solr 5 server
- Recommended that you do a full reindex regardless if you're upgrading your Solr server or not.