Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

LuceneIndex issue

Avatar

Employee Advisor

Hi ,

I have configured Lucene Full Text Index for /etc/commerce/products/geometrixx-outdoors and here is configuration -

{"jcr:primaryType":"oak:QueryIndexDefinition","compatVersion":2,"type":"lucene","async":"async","reindex":false,"reindexCount":7,"indexRules":{"jcr:primaryType":"nt:unstructured","nt:unstructured":{"jcr:primaryType":"nt:unstructured","properties":{"jcr:primaryType":"nt:unstructured","cqcommerceType":{"jcr:primaryType":"nt:unstructured","nodeScopeIndex":true,"useInSuggest":true,"propertyIndex":true,"useInSpellcheck":true,"name":"nt:unstructured/cq:commerceType","type":"String"}}}}}

While execution of following query: /jcr:root/etc/commerce/products/geometrixx_x002d_outdoors//*[@cq:commerceType='product'] using Explain query , I am getting No indexes were used. This is a traversal query.

Please find the attach file for more details and let me know if I have missed anything.

Thanks,

Debal

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi debal,

 Make sure you have the patch https://issues.apache.org/jira/browse/OAK-3156 Or

use nt:base instead of nt:unstructered.

Thanks,

View solution in original post

2 Replies

Avatar

Correct answer by
Level 9

Hi debal,

 Make sure you have the patch https://issues.apache.org/jira/browse/OAK-3156 Or

use nt:base instead of nt:unstructered.

Thanks,

Avatar

Employee Advisor

Hi,

Thanks for your input. I have used Oak Index Definition Generator and it gave me relevant output for /jcr:root/etc/commerce/products/geometrixx_x002d_outdoors//*[@cq:commerceType='product']

Output-

 - evaluatePathRestrictions = true
  - compatVersion = 2
  - type = "lucene"
  - async = "async"
  - jcr:primaryType = oak:QueryIndexDefinition
  + indexRules 
   + nt:base    (as you suggested)
    + properties 
     + commerceType 
      - name = "cq:commerceType"
      - propertyIndex = true

 

Now, its workingsmiley and  I am getting 

Indexes Used

productCatalogLucene(/oak:index/productCatalogLucene)

Thanks,

Debal