<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
    
    <!-- Indexer and searchers for lucene -->
    
    <bean id="luceneIndexerAndSearcherFactory"
        class="org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcherFactory2">
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="dictionaryService">
            <ref bean="dictionaryService" />
        </property>
        <property name="nameSpaceService">
            <ref bean="namespaceService" />
        </property>
        <property name="luceneFullTextSearchIndexer">
            <ref bean="LuceneFullTextSearchIndexer" />
        </property>
        <property name="indexRootLocation">
            <value>${dir.indexes}</value>
        </property>
        <property name="contentService">
            <ref bean="contentService" />
        </property>
        <property name="queryRegister">
            <ref bean="queryRegisterComponent" />
        </property>
        <property name="maxAtomicTransformationTime">
            <value>${lucene.maxAtomicTransformationTime}</value> 
        </property>
        <property name="queryMaxClauses">
            <value>${lucene.query.maxClauses}</value>
        </property>
        <property name="indexerBatchSize">
            <value>${lucene.indexer.batchSize}</value>
        </property>
        <property name="indexerMinMergeDocs">
            <value>${lucene.indexer.minMergeDocs}</value>
        </property>
        <property name="indexerMergeFactor">
            <value>${lucene.indexer.mergeFactor}</value>
        </property>
        <property name="indexerMaxMergeDocs">
            <value>${lucene.indexer.maxMergeDocs}</value>
        </property>
        <property name="lockDirectory">
            <value>${dir.indexes.lock}</value>
        </property>
        <property name="indexerMaxFieldLength">
            <value>${lucene.indexer.maxFieldLength}</value>
        </property>
        <property name="writeLockTimeout">
            <value>${lucene.write.lock.timeout}</value>
        </property>
        <property name="commitLockTimeout">
            <value>${lucene.commit.lock.timeout}</value>
        </property>
        <property name="lockPollInterval">
            <value>${lucene.lock.poll.interval}</value>
        </property>
    </bean>
    
    
    <!-- Bean to backup Lucene indexes -->
    
    <bean id="luceneIndexBackupComponent"
          class="org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcherFactory2$LuceneIndexBackupComponent">
        <property name="transactionService">
            <ref bean="transactionComponent" />
        </property>
        <property name="factory">
            <ref bean="luceneIndexerAndSearcherFactory" />
        </property>
        <property name="nodeService">
            <ref bean="nodeService" />
        </property>
        <property name="targetLocation">
            <value>${dir.root}/backup-lucene-indexes</value>
        </property>
    </bean>
    
</beans>