What indexes are used by TagManager.find() method? | Community
Skip to main content
Level 3
January 15, 2019

What indexes are used by TagManager.find() method?

  • January 15, 2019
  • 1 reply
  • 4257 views

I have a requirement where AEM List component should return results based on Tag query with multiple tags using "any tag" search mode. It works just fine with 1-2 tags, but with eh tags amount increase (5-6 is normal in our circumstances) it sometimes take several minutes to return results.

Our content is fully covered by indexes, including tags properties. Logs do not show any traversal queries so I'm wondering what might be the issue.

JCR query troubleshooting document mentions that for "Queries With Many OR or UNION Conditions", which should be the case here, are very expensive and their recommendation is to use aggregated indexes instead of simple property based.

I assume that under the hood com.day.cq.wcm.foundation.List class is using TagManager.find(String basePath, String[] tagIDs, boolean oneMatchIsEnough) method, so I'm wondering what is the query format in use by that method and how we can improve performance for queries explained above?

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

1 reply

Gaurav-Behl
Level 10
January 15, 2019

Did you get a chance to check the query explain plan (dump your query in logs and check)? You can validate if your query is not picking up your custom created indexes or you need to optimize the indexes - http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html

Tools > Operations > Diagnosis > QueryPerformance

Alternatively, you could also check the slow running queries on the server via -  http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html  > Slow queries

The default/global index for tags would be /oak:index/cqTagLucene unless you have cq:Tag node in your custom index(es) but your query may use multiple indexes as it find appropriate which would be reflected in the explain plan.

Level 3
January 15, 2019

The point is there is no "my query", I'm actually trying to figure out what that query is since sources of TagManager class implementation are not freely available and standard query debugging tools (logging querybuilder component) do not provide any insight

smacdonald2008
Level 10
January 15, 2019

Have you tried placing some custom indexes for this type of query.