private String updateLuceneMatchVersion(String content, String newLuceneMatchVersion) {
    return content.replaceAll("<luceneMatchVersion>.*</luceneMatchVersion>",
      "<luceneMatchVersion>" + newLuceneMatchVersion + "</luceneMatchVersion>");
  }
Upgrade lucene version to 7.4.0 in Solr config of Log Search collections and Solr Log4j config
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog271.java