我想在我的作业中实现基于 lucene 的休眠搜索。为了生成域对象,我使用 HyperJaxb3。
我希望在使用 HyperJaxb 创建域对象期间添加 @Indexed 注释。
我尝试使用谷歌搜索,但无法找到解决方案。
在这方面的任何指针都会有很大帮助。
我想在我的作业中实现基于 lucene 的休眠搜索。为了生成域对象,我使用 HyperJaxb3。
我希望在使用 HyperJaxb 创建域对象期间添加 @Indexed 注释。
我尝试使用谷歌搜索,但无法找到解决方案。
在这方面的任何指针都会有很大帮助。
这是它在架构中的外观:
....
xmlns:hs="http://annox.dev.java.net/org.hibernate.search.annotations"
...
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<annox:annotate>
<hs:FieldBridge impl="org.jvnet.hyperjaxb3.ejb.tests.annox.Items">
<params>
<hs:Parameter name="foo" value="bar"/>
</params>
</hs:FieldBridge>
</annox:annotate>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
您还可以使用额外的绑定文件(参见示例)。