Lucene Hibernate를 사용하여 색인을 생성하려는 기존 데이터가있는 데이터베이스가 있습니다. 새로운 데이터를 만들 때, Hibernate는 그것을 인덱스하지만 질문은 : 데이터베이스의 모든 이전 데이터를 어떻게 인덱스 할 수 있습니까?lucene 최대 절전 모드 검색을 사용하여 이미 생성 된 데이터베이스를 인덱싱하는 방법
이 내 persistence.xml
파일 다음 persistence.xml
file is to access entities from your DB의
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="persistenceUnit"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<properties>
<property name="hibernate.dialect" value="com.zodiac.qtp.domain.MySQL5CustomInnoDBDialect"/>
<!-- value="create" to build a new database on each run; value="update"
to modify an existing database; value="create-drop" means the same as "create"
but also drops tables when Hibernate closes; value="validate" makes no changes
to the database -->
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy" />
<property name="hibernate.connection.charSet" value="UTF8" />
<property name="hibernate.connection.characterEncoding" value="UTF8"/>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.generate_statistics" value="false" />
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" />
<!-- Uncomment the following two properties for JBoss only -->
<!-- property name="hibernate.validator.apply_to_ddl" value="false"/-->
<!-- property name="hibernate.validator.autoregister_listeners" value="false"/-->
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.impl.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="C:\ZAM_DEV\QTPGenerator-repository\lucene-indexes-v2"/>
</properties>
</persistence-unit>
</persistence>
고정 된 문법 및 코드 형식 – entpnerd