2017-01-23 21 views
0

我想知道是否索引选择逻辑更喜欢本地通过全局索引定义为相同的存储库路径。不幸的是,我没有找到关于索引选择算法如何工作的文档。为了使事情更清晰,考虑下面的例子:索引选择逻辑是否赞成Apache OAK中的全局索引?

全球 “myIndex” 的定义

/oak:index/myIndex 
    - jcr:primaryType = "oak:QueryIndexDefinition" 
    - compatVersion = 2 
    - type = "lucene" 
    - async = "async" 
    - evaluatePathRestrictions = true 
    - queryPaths="[/content]" 
    - includePaths="[/content]" 
    + indexRules 
    - jcr:primaryType = "nt:unstructured" 
    + nt:unstructured 
     + properties 
     - jcr:primaryType = "nt:unstructured" 
     + code 
      - jcr:primaryType = "nt:unstructured" 
      - propertyIndex = true 
      - name = "myprop" 

本地 “myIndex” 的定义

/content/oak:index/myIndex 
    - jcr:primaryType = "oak:QueryIndexDefinition" 
    - compatVersion = 2 
    - type = "lucene" 
    - async = "async" 
    - evaluatePathRestrictions = true 
    + indexRules 
    - jcr:primaryType = "nt:unstructured" 
    + nt:unstructured 
     + properties 
     - jcr:primaryType = "nt:unstructured" 
     + code 
      - jcr:primaryType = "nt:unstructured" 
      - propertyIndex = true 
      - name = "myprop" 

回答

2

指数选择逻辑计算查询所有索引(本地和全局)的成本。评估顺序索引中的第一个最便宜的索引用于查询。您可以通过AEM中的索引调试工具来查看。