我想通过 Magnolia 搜索将哪些属性编入索引/搜索并显示在摘录中。
我正在更改网站工作区中的indexing_configuration.xml。 删除索引并重新启动 Magnolia 并没有改变任何东西......
到现在为止,我的indexing_configuration.xml里有这个(在其他东西旁边( 但这些是我想包含在我的 ecxcerpt 中的字符串属性,其余的应该被排除在外:
<index-rule nodeType="nt:hierarchyNode">
<property boost="10" useInExcerpt="true">introTitle</property>
<property boost="1.0" useInExcerpt="true">introAbstract</property>
<property boost="1.0" useInExcerpt="true">contentText</property>
<property boost="1.0" useInExcerpt="true">subText</property>
<property boost="10" useInExcerpt="true">title</property>
<!-- exclude jcr:* and mgnl:* properties -->
<property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">.*:.*</property>
</index-rule>
<index-rule nodeType="mgnl:contentNode">
<property boost="5" nodeScopeIndex="false" useInExcerpt="true">introTitle</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">introAbstract</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">contentText</property>
<property boost="2" nodeScopeIndex="false" useInExcerpt="true">subText</property>
<property boost="5" nodeScopeIndex="false" useInExcerpt="true">title</property>
<!-- exclude jcr:* and mgnl:* properties -->
<property isRegexp="true" nodeScopeIndex="false" useInExcerpt="false">.*:.*</property>
</index-rule>
如何使其按预期工作?感谢您的帮助..
最可能的原因是 Magnolia/JR 没有看到您的新配置。是否更改了存储库配置(website
工作区中的workspace.xml
(以将其指向新的索引配置?
默认值如下所示:
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index" />
<!-- SearchIndex will get the indexing configuration from the classpath, if not found in the workspace home -->
<param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration.xml"/>
您需要将其指向新文件。
也不确定为什么根据nt:hierarchyNode
或mgnl:contentNode
设置索引,而不是使用更具体的mgnl:page
/mgnl:component