2014-10-02 31 views

回答

5

indexing_config.xml文件被嵌入到包com.day.crx.sling.server中。为了改变它,你需要从罐子里提取出来(见下文),复制到从同一目录中workspace.xml文件crx-quickstart/repository/workspaces/crx.default目录和参考:

<SearchIndex class="com.day.crx.query.lucene.LuceneHandler"> 
    <param name="path" value="${wsp.home}/index"/> 
    <param name="resultFetchSize" value="50"/> 
    <!-- this is the new line: --> 
    <param name="indexingConfiguration" value="${wsp.home}/indexing_config.xml"/> 
</SearchIndex> 

然后配置的Lucene索引你想要的任何方式。

提取indexing_config.xml

为了提取indexing_config.xml,先找到crx-core-*.jar文件crx-quickstart/launchpad/felix内。在Linux/Mac OS X中,你可以使用shell:

$ cd crx-quickstart 
$ find launchpad/felix -name 'crx-core-*.jar' 

然后从罐解压com/day/crx/query/lucene/indexing_config.xml文件:

$ unzip -j FOUND_JAR com/day/crx/query/lucene/indexing_config.xml -d repository/workspaces/crx.default 

或者,您也可以下载indexing_config.xmlfrom Adobe site并将其复制到相应的目录。

+0

太棒了!感谢你的回答! – nerd 2014-10-02 12:49:11