如何优化Oak Lucene索引以减少索引时间
使用includedPaths和excludedPaths属性优化Oak Lucene索引。
描述 description
环境
- Adobe Experience Manager 6.0 + Oak 1.0.16或更高版本
- Adobe Experience Manager 6.1和6.2
问题/症状
优化AEM Oak Lucene索引以减少重新索引时间。
解决方法 resolution
您可以通过微调Oak: QueryIndexDefinition
的includedPaths
、excludedPaths
、name
和indexPath
等属性来优化Oak Lucene索引。
includedPaths
和excludedPaths
属性限制索引在重新索引时遍历的路径以及它侦听索引更新的路径。name
和indexPath
属性使索引日志更容易理解,因为它们会使用索引的路径或名称标记日志消息。 例如:
30.01.2017 14:07:12.934 *DEBUG* [ pool-8-thread-2] org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor [ damassetlucene(
/oak
:index
/damAssetLucene
)] => Indexed 9000 nodes...
优化索引的步骤:
- 前往 http://aem-host:port/crx/de/index.jsp 并以管理员身份登录。
- 浏览到
/oak:index
。 - 将
[
1]
下方高亮显示的属性添加到相应的索引。includedPaths
和excludedPaths
属性应为multi-value String (String[ ] )
。 - 在CRXDe中单击 全部保存。
[
1]
/oak:index属性修改
"authorizables"
: {
"includedPaths"
: [
"/home"
] ,
"reindexCount"
: 1,
"name"
:
"authorizables"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/authorizables"
},
"cqPageLucene"
: {
"includedPaths"
: [
"/content"
,
"/etc"
] ,
"reindexCount"
: 1,
"name"
:
"cq:Page"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/cqPageLucene"
},
"cqTagLucene"
: {
"reindexCount"
: 1,
"name"
:
"cqTag"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"excludedPaths"
: [
"/var"
,
"/tmp"
,
"/etc/replication"
,
"/etc/workflow/instances"
,
"/jcr:system"
] ,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/cqTagLucene"
},
"damAssetLucene"
: {
"includedPaths"
: [
"/content/dam"
] ,
"evaluatePathRestrictions"
:
true
,
"reindexCount"
: 1,
"name"
:
"damassetlucene"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/damAssetLucene"
},
"lucene"
: {
"reindexCount"
: 1,
"name"
:
"lucene"
,
"reindex"
:
false
,
"includePropertyTypes"
: [
"String"
] ,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"excludedPaths"
: [
"/var"
,
"/tmp"
,
"/etc/replication"
,
"/etc/workflow/instances"
,
"/jcr:system"
] ,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/lucene"
},
"ntBaseLucene"
: {
"reindexCount"
: 1,
"name"
:
"tags"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"excludedPaths"
: [
"/var"
,
"/tmp"
,
"/etc/replication"
,
"/etc/workflow/instances"
,
"/jcr:system"
] ,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/ntBaseLucene"
},
"workflowDataLucene"
: {
"reindexCount"
: 1,
"name"
:
"workflow"
,
"compatVersion"
: 2,
"reindex"
:
false
,
"type"
:
"lucene"
,
"jcr:primaryType"
:
"oak:QueryIndexDefinition"
,
"excludedPaths"
: [
"/var"
,
"/tmp"
,
"/etc/replication"
,
"/jcr:system"
] ,
"async"
:
"async"
,
"indexPath"
:
"/oak:index/workflowDataLucene"
}
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f