用compass快速给你的网站添加搜索功能
private String CName;
private String EName;
private String alias;
private String genre;
pivate String director;
private Date createTime;
return this.id;
}
this.id = id;
}
return this.CName;
}
this.CName = CName;
}
return this.EName;
}
this.EName = EName;
}
return this.alias;
}
this.alias = alias;
}
return this.genre
}
this.genre= genre;
}
return this.director;
}
this.director = director;
}
return this.ceateTime;
}
this.ceateTime = ceateTime;
}
return this.updateTime;
}
this.updateTime = updateTime;
}
"-//Compass/Compass Core Mapping DTD 1.0//EN"
"http://www.opensymphony.com/compass/dtd/compass-core-mapping.dtd">
<compass-core-mapping package="com.jack.video"
index="video-index">
<id name="id" />
<property name="CName">
<meta-data index="tokenized">CName</meta-data>
</property>
<property name="EName">
<meta-data index="tokenized">EName</meta-data>
</property>
<property name="alias">
<meta-data index="tokenized">alias</meta-data>
</property>
<property name="genre">
<meta-data index="un_tokenized">genre</meta-data>
</property>
<property name="director">
<meta-data index="tokenized">director</meta-data>
</property>
<property name="createTime">
<meta-data index="no">trueCreateTime</meta-data>
</property>
<property name="updateTime">
<meta-data index="no">updateTime</meta-data>
</property>
</class>
</compass-core-mapping>
index="video-index"> .name就是类名了。alias就是给这个类在起一个别名。index是指生成索引所在的文件夹的名字。后面你就会明白的。
<meta-data index="tokenized">CName</meta-data>
</property>
<bean id="compass" class="org.compass.spring.LocalCompassBean">
<property name="compassSettings">
<props>
<prop key="compass.engine.connection">E:/video</prop>
<prop key="compass.transaction.factory">
org.compass.spring.transaction.SpringSyncTransactionFactory
</prop>
<prop
key="compass.engine.highlighter.default.formatter.simple.pre">
<![CDATA[<font color="red"><b>]]>
</prop>
<prop
key="compass.engine.highlighter.default.formatter.simple.post">
<![CDATA[</b></font>]]>
</prop>
</props>
</property>
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="resourceLocations">
<list>
<value>
classpath:com/jack/video/Video.cpm.xml
</value>
</list>
</property>
</bean>
<!-- 同步更新索引 -->
<bean id="hibernateGps"
class="org.compass.gps.impl.SingleCompassGps" init-method="start"
destroy-method="stop">
<property name="compass">
<ref bean="compass" />
</property>
<property name="gpsDevices">
<list>
<bean
class="org.compass.spring.device.SpringSyncTransactionGpsDeviceWrapper">
<property name="gpsDevice" ref="hibernateGpsDevice" />
</bean>
</list>
</property>
</bean>
<!--hibernate驱动 链接compass和hibernate -->
<bean id="hibernateGpsDevice"
class="org.compass.spring.device.hibernate.dep.SpringHibernate3GpsDevice">
<property name="name">
<value>hibernateDevice</value>
</property>
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>