SOLR-5190 (backport)

apply patch in full (including test)