1

我想做一个列入白名单的属性索引/搜索,并在Magnolia搜索摘录中显示。Jackrabbit索引配置白名单(Magnolia CMS 5.5.5全文搜索)

我正在更改我的网站工作区中的indexing_configuration.xml。 删除索引并重新启动木兰没有任何改变......

现在我有这个在我indexing_configuration.xml(旁边其他的东西) 但这些都是我想在我的ecxcerpt其余包括String类型的属性应该被排除在外:

<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> 

我怎样才能得到这个按预期工作?感谢您的帮助..

回答

2

最有可能的原因是Magnolia/JR没有看到您的新配置。您是否更改回购配置(workspace.xmlwebsite工作区中)以将其指向新的索引配置?

默认看起来像: <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:hierarchyNodemgnl:contentNode设置索引而不是用更具体的mgnl:page/mgnl:component

+1

谢谢您的回答扬,但我仍然有一个问题。现在我可以通过设置nodeScopeIndex =“false”和useInExcerpt =“false”从FullTextIndex中排除一些属性。摘录看起来更干净。但现在它在摘录(多次)中显示“管理员”和“超级用户”,应该使用。*:。*。 。 这里有什么问题? – reencode

+1

我发现它..我需要索引规则:mgnl:页面,mgnl:组件和mgnl:区域... – reencode