Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

LuceneIndex issue

DEBAL_DAS
Level 4
Level 4

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
MC_Stuff
Correct answer by
Level 9
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
MC_Stuff
Correct answer by
Level 9
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

DEBAL_DAS
Level 4
Level 4

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