如何优化Oak Lucene索引以缩短索引时间

描述

环境

  • Adobe Experience Manager 6.0 + Oak 1.0.16或更高版本
  • Adobe Experience Manager 6.1 和 6.2

问题/症状
优化AEM Oak Lucene索引,以缩短重新索引时间。

分辨率

您可以通过优化Oak,优化Oak Lucene索引: QueryIndexDefinition ,例如 includedPaths, excludedPaths, nameindexPath.

  • includedPathsexcludedPaths 属性会限制索引在重新索引时遍历的路径以及索引侦听的索引更新路径。
  • nameindexPath 属性使索引日志更易于理解,因为它们会使用索引的路径或名称标记日志消息。 例如:
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...

优化索引的步骤:

  1. 转到 http://aem-host:port/crx/de/index.jsp​并以管理员身份登录。
  2. 浏览到 /oak:index.
  3. 将下面突出显示的属性添加到相应的索引中。 的 includedPaths  excludedPaths 属性应 multi-value String (String).
  4. 单击 全部保存 在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"

     }

在此页面上