【发布时间】:2012-01-02 22:17:55
【问题描述】:
当我执行 jackrabbit(版本 2.2.9)搜索并调用 get row.getValue("rep:excerpt()") 时,返回的字符串只是连接的所有属性(不包括 jcr:properties)。我该如何控制?例如。如果我在搜索“foo”时有一个名为“description”的属性包含“bla foo bla”,我希望看到 rep:excerpt() 仅返回部分描述。
我尝试创建一个索引配置(并在测试之间删除了我的存储库)以试图控制哪些属性被索引,但无济于事。
Workspace.xml...
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
<param name="supportHighlighting" value="true"/>
<param name="excerptProviderClass" value="org.apache.jackrabbit.core.query.lucene.DefaultHTMLExcerpt"/>
<param name="indexingConfiguration" value="${wsp.home}/indexing_configuration.xml"/>
</SearchIndex>
indexing_configuration.xml
<?xml version="1.0"?>
<!DOCTYPE configuration SYSTEM "http://jackrabbit.apache.org/dtd/indexing-configuration-1.0.dtd">
<configuration xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
<index-rule nodeType="nt:teneoNode">
<property>description</property>
<property>input</property>
<property>key</property>
<property>comment</property>
</index-rule>
</configuration>
谢谢。
泰德。
【问题讨论】:
标签: lucene highlighting jackrabbit