0

我想知道索引选择逻辑是否更喜欢相同存储库路径的本地索引定义而不是全局索引定义。不幸的是,我找不到任何关于索引选择算法如何工作的文档。为了使事情更清楚,请考虑以下示例:

“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"
4

1 回答 1

2

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

于 2017-01-23T17:00:29.707 回答