
META-INF.batch-jobs.hibernate-search-mass-indexing.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Hibernate Search, full-text search for your domain model ~ ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. --> <job id="hibernate-search-mass-indexing" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd" version="1.0"> <listeners> <listener ref="org.hibernate.search.jsr352.massindexing.impl.JobContextSetupListener"> <properties> <property name="entityManagerFactoryNamespace" value="#{jobParameters['entityManagerFactoryNamespace']}" /> <property name="entityManagerFactoryReference" value="#{jobParameters['entityManagerFactoryReference']}" /> <property name="entityTypes" value="#{jobParameters['entityTypes']}" /> <property name="maxThreads" value="#{jobParameters['maxThreads']}" /> <property name="maxResultsPerEntity" value="#{jobParameters['maxResultsPerEntity']}" /> <property name="idFetchSize" value="#{jobParameters['idFetchSize']}" /> <property name="entityFetchSize" value="#{jobParameters['entityFetchSize']}" /> <property name="cacheMode" value="#{jobParameters['cacheMode']}" /> <property name="optimizeOnFinish" value="#{jobParameters['optimizeOnFinish']}" /> <property name="optimizeAfterPurge" value="#{jobParameters['optimizeAfterPurge']}" /> <property name="purgeAllOnStart" value="#{jobParameters['purgeAllOnStart']}" /> <property name="sessionClearInterval" value="#{jobParameters['sessionClearInterval']}" /> <property name="checkpointInterval" value="#{jobParameters['checkpointInterval']}" /> <property name="rowsPerPartition" value="#{jobParameters['rowsPerPartition']}" /> <property name="customQueryCriteria" value="#{jobParameters['customQueryCriteria']}" /> </properties> </listener> </listeners> <step id="beforeChunk" next="produceLuceneDoc"> <batchlet ref="org.hibernate.search.jsr352.massindexing.impl.steps.beforechunk.BeforeChunkBatchlet"> <properties> <property name="optimizeAfterPurge" value="#{jobParameters['optimizeAfterPurge']}" /> <property name="purgeAllOnStart" value="#{jobParameters['purgeAllOnStart']}" /> <property name="tenantId" value="#{jobParameters['tenantId']}" /> </properties> </batchlet> </step> <step id="produceLuceneDoc" next="afterChunk"> <listeners> <listener ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.StepProgressSetupListener"> <properties> <property name="tenantId" value="#{jobParameters['tenantId']}" /> <property name="customQueryHQL" value="#{jobParameters['customQueryHQL']}" /> </properties> </listener> </listeners> <!-- Here we use the property from the partition plan, so that defaults are correctly applied --> <chunk item-count="#{partitionPlan['checkpointInterval']}"> <reader ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.EntityReader"> <properties> <!-- Used to re-create the job context data as necessary --> <property name="entityManagerFactoryNamespace" value="#{jobParameters['entityManagerFactoryNamespace']}" /> <property name="entityManagerFactoryReference" value="#{jobParameters['entityManagerFactoryReference']}" /> <property name="entityTypes" value="#{jobParameters['entityTypes']}" /> <property name="customQueryCriteria" value="#{jobParameters['customQueryCriteria']}" /> <property name="entityName" value="#{partitionPlan['entityName']}" /> <property name="partitionId" value="#{partitionPlan['partitionId']}" /> <property name="lowerBound" value="#{partitionPlan['lowerBound']}" /> <property name="upperBound" value="#{partitionPlan['upperBound']}" /> <property name="indexScope" value="#{partitionPlan['indexScope']}" /> <property name="tenantId" value="#{jobParameters['tenantId']}" /> <property name="cacheMode" value="#{jobParameters['cacheMode']}" /> <property name="entityFetchSize" value="#{jobParameters['entityFetchSize']}" /> <!-- Here we use the property from the partition plan, so that defaults are correctly applied --> <property name="checkpointInterval" value="#{partitionPlan['checkpointInterval']}" /> <property name="sessionClearInterval" value="#{jobParameters['sessionClearInterval']}" /> <property name="customQueryHQL" value="#{jobParameters['customQueryHQL']}" /> <property name="maxResultsPerEntity" value="#{jobParameters['maxResultsPerEntity']}" /> </properties> </reader> <processor ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.LuceneDocProducer"> <properties> <property name="entityName" value="#{partitionPlan['entityName']}" /> <property name="tenantId" value="#{jobParameters['tenantId']}" /> </properties> </processor> <writer ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.LuceneDocWriter"> <properties> <property name="entityName" value="#{partitionPlan['entityName']}" /> <property name="partitionId" value="#{partitionPlan['partitionId']}" /> </properties> </writer> </chunk> <partition> <mapper ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.PartitionMapper"> <properties> <property name="tenantId" value="#{jobParameters['tenantId']}" /> <property name="idFetchSize" value="#{jobParameters['idFetchSize']}" /> <property name="customQueryHQL" value="#{jobParameters['customQueryHQL']}" /> <property name="maxThreads" value="#{jobParameters['maxThreads']}" /> <property name="maxResultsPerEntity" value="#{jobParameters['maxResultsPerEntity']}" /> <property name="checkpointInterval" value="#{jobParameters['checkpointInterval']}" /> <property name="rowsPerPartition" value="#{jobParameters['rowsPerPartition']}" /> </properties> </mapper> <collector ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.ProgressCollector" /> <analyzer ref="org.hibernate.search.jsr352.massindexing.impl.steps.lucene.ProgressAggregator" /> </partition> </step> <step id="afterChunk"> <batchlet ref="org.hibernate.search.jsr352.massindexing.impl.steps.afterchunk.AfterChunkBatchlet"> <properties> <property name="optimizeOnFinish" value="#{jobParameters['optimizeOnFinish']}" /> <property name="tenantId" value="#{jobParameters['tenantId']}" /> </properties> </batchlet> </step> </job>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy