OAK Indexing | Custom Lucene index | AEM 6.3 | Community
Skip to main content
prabodh
Level 2
February 10, 2018
Question

OAK Indexing | Custom Lucene index | AEM 6.3

  • February 10, 2018
  • 5 replies
  • 2612 views

I am working on optimizing a query by indexing so that it will not traverse through all the nodes. I have created an index definition with the help of Oak Index Definition Generator.

XML of the index definition :

<?xml version="1.0" encoding="UTF-8"?><jcr:root xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">

<myIndex compatVersion="{Long}2" async="async" jcr:primaryType="oak:QueryIndexDefinition" evaluatePathRestrictions="{Boolean}true" type="lucene">

<indexRules jcr:primaryType="nt:unstructured">

<nt:base jcr:primaryType="nt:unstructured">

<properties jcr:primaryType="nt:unstructured">

  <prop1 name="prop1" propertyIndex="{Boolean}true" jcr:primaryType="nt:unstructured" nullCheckEnabled="{Boolean}true"/>

  <prop2 name="prop2" ordered="{Boolean}true" jcr:primaryType="nt:unstructured"/>

  <prop3 name="prop3" propertyIndex="{Boolean}true" jcr:primaryType="nt:unstructured"/>

</properties>

</nt:base>

</indexRules>

</myIndex>

</jcr:root>

But it looks like there is something wrong with the configuration or the way I created the index definition. Could anyone help me out in configuring lucene index.

Below is the Xpath query that's been used to generate the index definition :

/jcr:root/content/xyz//*  [ (not(@prop1) or @prop1= 'false')  and ((@prop3= 'apps/components/pages/xyz' or @prop3= '/apps/mda/components/pages/abc'))  ] order by @prop2 descending

Please let me know if there's anything I am missing here.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

smacdonald2008
Level 10
February 10, 2018

Here is a helpful Oak Index resource...

Oak Lucene Indexes

smacdonald2008
Level 10
February 10, 2018

Here is another good resource on this topic:

Oak Queries and Indexing

smacdonald2008
Level 10
February 10, 2018

Please post a screenshot of where you setup your index.

prabodh
prabodhAuthor
Level 2
February 12, 2018

Please let me know if I am creating the index definition at the appropriate place, below is the screenshot.

smacdonald2008
Level 10
February 14, 2018

In the GEMS webinar i posted above - they go into detail. I recommend watching that as well.