Exemplo n.º 1
0
 private Version getLuceneMatchVersion(SearchConfiguration cfg) {
   final Version version;
   String tmp = cfg.getProperty(Environment.LUCENE_MATCH_VERSION);
   if (StringHelper.isEmpty(tmp)) {
     log.recommendConfiguringLuceneVersion();
     version = Environment.DEFAULT_LUCENE_MATCH_VERSION;
   } else {
     try {
       version = Version.parseLeniently(tmp);
       if (log.isDebugEnabled()) {
         log.debug("Setting Lucene compatibility to Version " + version);
       }
     } catch (IllegalArgumentException e) {
       throw log.illegalLuceneVersionFormat(tmp, e.getMessage());
     } catch (ParseException e) {
       throw log.illegalLuceneVersionFormat(tmp, e.getMessage());
     }
   }
   return version;
 }