2017-01-23 22 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中的索引調試工具來查看。