Package org.apache.lucene.util

Examples of org.apache.lucene.util.Version


    runData.setIndexWriter(configureWriter(config, runData, OpenMode.CREATE, null));
    return 1;
  }
 
  public static IndexWriterConfig createWriterConfig(Config config, PerfRunData runData, OpenMode mode, IndexCommit commit) {
    Version version = Version.valueOf(config.get("writer.version", Version.LUCENE_40.toString()));
    IndexWriterConfig iwConf = new IndexWriterConfig(version, runData.getAnalyzer());
    iwConf.setOpenMode(mode);
    IndexDeletionPolicy indexDeletionPolicy = getIndexDeletionPolicy(config);
    iwConf.setIndexDeletionPolicy(indexDeletionPolicy);
    if(commit != null)
View Full Code Here


      return false;
    }
  }

  private Version getLuceneMatchVersion(SearchConfiguration cfg) {
    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.valueOf( tmp );
        if ( log.isDebugEnabled() ) {
          log.debug( "Setting Lucene compatibility to Version " + version.name() );
        }
      }
      catch ( IllegalArgumentException e ) {
        StringBuilder msg = new StringBuilder( tmp );
        msg.append( " is a invalid value for the Lucene match version. Possible values are: " );
View Full Code Here

      ReflectionManager reflectionManager, Set<XClass> optimizationBlackList, InstanceInitializer instanceInitializer) {

    if ( xClass == null ) {
      throw new AssertionFailure( "Unable to build a DocumentBuilderContainedEntity with a null class" );
    }
    final Version luceneVersion = context.getLuceneMatchVersion();

    this.passThroughAnalyzer = new PassThroughAnalyzer( luceneVersion );
    this.instanceInitalizer = instanceInitializer;
    this.entityState = EntityState.CONTAINED_IN_ONLY;
    this.beanXClass = xClass;
View Full Code Here

      return false;
    }
  }

  private Version getLuceneMatchVersion(SearchConfiguration cfg) {
    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.valueOf( tmp );
        if ( log.isDebugEnabled() ) {
          log.debug( "Setting Lucene compatibility to Version " + version.name() );
        }
      }
      catch (IllegalArgumentException e) {
        StringBuilder msg = new StringBuilder( tmp );
        msg.append( " is a invalid value for the Lucene match version. Possible values are: " );
View Full Code Here

      return false;
    }
  }

  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;
    }
View Full Code Here

      return false;
    }
  }

  private Version getLuceneMatchVersion(SearchConfiguration cfg) {
    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.valueOf( tmp );
        if ( log.isDebugEnabled() ) {
          log.debug( "Setting Lucene compatibility to Version " + version.name() );
        }
      }
      catch (IllegalArgumentException e) {
        StringBuilder msg = new StringBuilder( tmp );
        msg.append( " is a invalid value for the Lucene match version. Possible values are: " );
View Full Code Here

    }

    public Builder(Class<?> indexedType, ConfigContext configContext, ScopedAnalyzer scopedAnalyzer) {
      this.indexedType = indexedType;
      this.scopedAnalyzer = scopedAnalyzer;
      Version luceneVersion = configContext.getLuceneMatchVersion();
      this.passThroughAnalyzer = new PassThroughAnalyzer( luceneVersion );
    }
View Full Code Here

      assertTrue("unexpected version: " + p.getSpecificationVersion(),
          p.getSpecificationVersion().startsWith(EXPECTED_SOLR_VERSION));
      assertTrue("unexpected version: " + p.getImplementationVersion(),
          p.getImplementationVersion().startsWith(EXPECTED_SOLR_VERSION));
     
      Version expectedMinorLuceneVersion = getMinorLuceneVersion(EXPECTED_SOLR_VERSION);
      System.out.println("expectedMinorLuceneVersion: " + expectedMinorLuceneVersion);
      assertTrue(Version.LUCENE_CURRENT.onOrAfter(expectedMinorLuceneVersion));
    }   
  }
View Full Code Here

      assertTrue("unexpected version: " + p.getSpecificationVersion(),
          p.getSpecificationVersion().startsWith(EXPECTED_SOLR_VERSION));
      assertTrue("unexpected version: " + p.getImplementationVersion(),
          p.getImplementationVersion().startsWith(EXPECTED_SOLR_VERSION));
     
      Version expectedMinorLuceneVersion = getMinorLuceneVersion(EXPECTED_SOLR_VERSION);
      System.out.println("expectedMinorLuceneVersion: " + expectedMinorLuceneVersion);
      assertTrue(Version.LUCENE_CURRENT.onOrAfter(expectedMinorLuceneVersion));
    }   
  }
View Full Code Here

    }
  }

  /** */
  public final void testKeywordAttrTokens() throws IOException {
    final Version version = TEST_VERSION_CURRENT;

    Analyzer a = new MorfologikAnalyzer(version) {
      @Override
      protected TokenStreamComponents createComponents(String field, Reader reader) {
        final CharArraySet keywords = new CharArraySet(version, 1, false);
View Full Code Here

TOP

Related Classes of org.apache.lucene.util.Version

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.