在 Apache OAK 中,索引选择逻辑是否支持本地索引而不是全局索引?

Does the index selection logic favor local over global index in 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"

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