Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Creating index for query in aem6.3 which has a path that is dynamic

Avatar

Level 8

Hi,

I have component that sends a query  based on the path selected from dialog .This is basically a case when we need to generate reports data based on different path author wants

 

like the author could select path: /content/project/abc

then they could select a different path like : /content/project/def

 

Then we would get a different report. Since a query may slow down the system based on the results it needs to get.

 

Please let me know what should be approach for this as path is dynamic here

 

How could i create index from below for such a use case

You can create an index of your query on the Oak Index Definition Generator:

https://oakutils.appspot.com/generate/index

 

Generating custom indexes on queries:

https://helpx.adobe.com/experience-manager/kb/create-custom-oak-index.html

 

Thanks

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@srinivas_chann1 what kind of reports you are trying to generate? How much content do you hold and expected in future? Do you also need to query DAM assets? Is the query execution on author or publisher?

 

If data is a small subset, I would just go with cq:pagelucene or cq:damlucene in oak definitions to add all required properties you do search.

 

If data is huge or multiple operations I would recommend to have a separate search servers such as solr etc..

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

@srinivas_chann1 what kind of reports you are trying to generate? How much content do you hold and expected in future? Do you also need to query DAM assets? Is the query execution on author or publisher?

 

If data is a small subset, I would just go with cq:pagelucene or cq:damlucene in oak definitions to add all required properties you do search.

 

If data is huge or multiple operations I would recommend to have a separate search servers such as solr etc..

Avatar

Level 8

Thanks for the input. The data is small subset, but like I mentioned if the query for 2 authors could be different  based on path. Then how will be index be for this.

 

Should I create 4 different index or just 1 index and say   if path could support any wildcard path like /content/product/*

 

{path=/content/product/abc1, p.limit=-1, property.value=/apps/components/test1, property=sling:resourceType, type=nt:unstructured}
{path=/content/product/def2, p.limit=-1, property.value=/apps/components/test1, property=sling:resourceType, type=nt:unstructured}
{path=/content/product/def3, p.limit=-1, property.value=/apps/components/test1, property=sling:resourceType, type=nt:unstructured}
{path=/content/product/def4, p.limit=-1, property.value=/apps/components/test1, property=sling:resourceType, type=nt:unstructure}

 

Thanks

Avatar

Community Advisor
Then go ahead and add those properties which you are querying on to cq:PageLucene index.

Avatar

Level 8
Hi, Could you please provide a sample as how this will look

Avatar

Community Advisor

Hi @srinivas_chann1,

Before deciding on creating custom index definition, I suggest to

Given that you confirm the data volume to be small, there might not be a need to create custom one. (provided the content volume is arrived at considering long run)

If you are still looking for creating one, request to share the query predicate that you are using, I will try in my local and share sample custom index definition.