backport search_lucene 0.5.0 updates to stable5