I checked the lucene version - the version of luke I have is bound to 2.2 which is what I have in my app's classpath, so that's out.
Here's the code doing the indexing:
Code:
String query = "SELECT f FROM FoilImpl f";
s = vslHibernateSessionFactory.openSession();
// Query q = s.createQuery(query);
// List<Foil> foils = (List<Foil>)q.list();
FullTextSession fullTextSession = org.hibernate.search.Search.createFullTextSession(s);
Criteria c = fullTextSession.createCriteria(FoilImpl.class);
Transaction tx = fullTextSession.beginTransaction();
for (Foil foil : (List<Foil>)c.list()) {
fullTextSession.index(foil);
}
tx.commit();
Here's the FoilImpl class: (slightly abbreviated)
Code:
@Indexed()
public class FoilImpl extends VSLObjectImpl implements Foil {
@DocumentId
public String getId() {
return this.id;
}
@Field(index=Index.TOKENIZED)
public String getIdentifier(){
return identifier;
}
}
The mapping for foil:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.company.vsl.beans.FoilImpl" table="FOIL" proxy="org.company.vsl.beans.Foil">
<id name="id" column="FOIL_ID">
<generator class="uuid"/>
</id>
<property name="key" column="KEY_FL" />
<property name="createdBy" column="CREATED_BY_NM" />
<property name="createdOn" column="CREATED_ON_DT" type="timestamp" />
<property name="updatedBy" column="UPDATED_BY_NM" />
<property name="updatedOn" column="UPDATED_ON_DT" type="timestamp" />
<many-to-one name="interaction" lazy="proxy" class="org.company.vsl.beans.InteractionImpl" column="INTERACTION_ID" not-null="true" insert="false" update="false" not-found="ignore"/>
</class>
</hibernate-mapping>
and in the session factory configuration I'm setting:
Code:
<prop key="hibernate.lucene.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
<prop key="hibernate.lucene.default.indexBase">c:/vslIndexes</prop>
<prop key="hibernate.search.default.indexBase">vsl</prop>
as well as the appropriate listeners. I get 2 files in c:/vslIndexes - 4 or 5 bytes each... it's as thought the commit isn't quite flushing the entire index to the FS.
If there's something I forgot to include let me know.
Thanks for the assist.