Package org.hibernate.search.backend

Examples of org.hibernate.search.backend.LuceneIndexingParameters$ParameterSet


    searchFactoryImplementor.addOptimizerStrategy(provider, optimizerStrategy);
  }
 
  private void configureIndexingParameters(SearchFactoryImplementor searchFactoryImplementor, Properties indexProps, DirectoryProvider<?> provider) {
   
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters();
    String s = indexProps.getProperty(TRANSACTION + MERGE_FACTOR);
   
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMergeFactor(Integer.valueOf(s));
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MERGE_FACTOR + ": " + s);
      }
    }

    s = indexProps.getProperty(TRANSACTION + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxMergeDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(TRANSACTION + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxBufferedDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_BUFFERED_DOCS + ": " + s);
      }
    }   
       
    s = indexProps.getProperty(BATCH + MERGE_FACTOR);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MERGE_FACTOR + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_BUFFERED_DOCS + ": " + s);
      }
    } 
    searchFactoryImplementor.addIndexingParmeters(provider, indexingParams);
View Full Code Here


   * @param indexProps The properties extracted from the configuration.
   * @param provider The direcotry provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(SearchFactoryImplementor searchFactoryImplementor, Properties indexProps, DirectoryProvider<?> provider) {
   
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters();
    String s = indexProps.getProperty(TRANSACTION + MERGE_FACTOR);
   
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMergeFactor(Integer.valueOf(s));
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MERGE_FACTOR + ": " + s);
      }
    }

    s = indexProps.getProperty(TRANSACTION + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxMergeDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(TRANSACTION + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxBufferedDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_BUFFERED_DOCS + ": " + s);
      }
    }   
       
    s = indexProps.getProperty(BATCH + MERGE_FACTOR);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MERGE_FACTOR + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_BUFFERED_DOCS + ": " + s);
      }
    } 
    searchFactoryImplementor.addIndexingParmeters(provider, indexingParams);
View Full Code Here

   * @param directoryProperties    The properties extracted from the configuration.
   * @param provider         The directory provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(WritableBuildContext context,
                       Properties directoryProperties, DirectoryProvider<?> provider) {
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters( directoryProperties );
    context.addIndexingParameters( provider, indexingParams );
  }
View Full Code Here

   * @param directoryProperties The properties extracted from the configuration.
   * @param provider The directory provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(WritableBuildContext context,
                       Properties directoryProperties, DirectoryProvider<?> provider) {
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters( directoryProperties );
    context.addIndexingParameters( provider, indexingParams );
  }
View Full Code Here

   * @param directoryProperties    The properties extracted from the configuration.
   * @param provider         The directory provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(WritableBuildContext context,
                       Properties directoryProperties, DirectoryProvider<?> provider) {
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters( directoryProperties );
    context.addIndexingParameters( provider, indexingParams );
  }
View Full Code Here

    assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
    assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
  }
 
  public void testSerializability() throws IOException, ClassNotFoundException {
    LuceneIndexingParameters param = new LuceneIndexingParameters( new Properties() );
    LuceneIndexingParameters paramCopy = (LuceneIndexingParameters)
      SerializationTestHelper.duplicateBySerialization( param );
    assertEquals( param.getBatchIndexParameters(), paramCopy.getBatchIndexParameters() );
    assertEquals( param.getTransactionIndexParameters(), paramCopy.getTransactionIndexParameters() );
  }
View Full Code Here

   * @param indexProps The properties extracted from the configuration.
   * @param provider The direcotry provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(SearchFactoryImplementor searchFactoryImplementor, Properties indexProps, DirectoryProvider<?> provider) {
   
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters();
    String s = indexProps.getProperty(TRANSACTION + MERGE_FACTOR);
   
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMergeFactor(Integer.valueOf(s));
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MERGE_FACTOR + ": " + s);
      }
    }

    s = indexProps.getProperty(TRANSACTION + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxMergeDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(TRANSACTION + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setTransactionMaxBufferedDocs(Integer.valueOf(s));
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + TRANSACTION + MAX_BUFFERED_DOCS + ": " + s);
      }
    }   
       
    s = indexProps.getProperty(BATCH + MERGE_FACTOR);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMergeFactor(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MERGE_FACTOR + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_MERGE_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxMergeDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_MERGE_DOCS + ": " + s);
      }
    }
   
    s = indexProps.getProperty(BATCH + MAX_BUFFERED_DOCS);
    if (!StringHelper.isEmpty( s )) {
      try{
        indexingParams.setBatchMaxBufferedDocs(Integer.valueOf(s));
      } catch (NumberFormatException ne) {
        throw new SearchException("Invalid value for " + BATCH + MAX_BUFFERED_DOCS + ": " + s);
      }
    } 
    searchFactoryImplementor.addIndexingParmeters(provider, indexingParams);
View Full Code Here

   * @param directoryProperties The properties extracted from the configuration.
   * @param provider The directory provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(WritableBuildContext context,
                       Properties directoryProperties, DirectoryProvider<?> provider) {
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters( directoryProperties );
    context.addIndexingParameters( provider, indexingParams );
  }
View Full Code Here

    assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
    assertValueIsDefault( Document.class, TRANSACTION, RAM_BUFFER_SIZE );
  }
 
  public void testSerializability() throws IOException, ClassNotFoundException {
    LuceneIndexingParameters param = new LuceneIndexingParameters( new Properties() );
    LuceneIndexingParameters paramCopy = (LuceneIndexingParameters)
      SerializationTestHelper.duplicateBySerialization( param );
    assertEquals( param.getBatchIndexParameters(), paramCopy.getBatchIndexParameters() );
    assertEquals( param.getTransactionIndexParameters(), paramCopy.getTransactionIndexParameters() );
  }
View Full Code Here

   * @param directoryProperties    The properties extracted from the configuration.
   * @param provider         The directory provider for which to configure the indexing parameters.
   */
  private void configureIndexingParameters(SearchFactoryImplementor searchFactoryImplementor,
                       Properties directoryProperties, DirectoryProvider<?> provider) {
    LuceneIndexingParameters indexingParams = new LuceneIndexingParameters( directoryProperties );
    searchFactoryImplementor.addIndexingParameters( provider, indexingParams );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.search.backend.LuceneIndexingParameters$ParameterSet

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.