Skip to main content
broman__pl
Level 3
Apr 14, 2022 11:54 PM UTC
Solved

apache slign sitemap oak index

To use ootb functionality to generate sitemap using apache sling module should I create some oak indexes?

Right now only on demand option is working for me and scheduled generation only express itself in this warning

14.04.2022 16:20:00.120 *WARN* [sling-default-4-we-retail en-US Sitemaps] org.apache.jackrabbit.oak.query.QueryImpl Traversal query (query without index): select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail/global/en') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail/global/en//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */; consider creating an index

 Is there a suggested index that I should create to make it work?

I added this one with name as suggested

{
"jcr:primaryType": "oak:QueryIndexDefinition",
"compatVersion": 2,
"includedPaths": [
"/content/we-retail"
],
"seed": -8084877133496368591,
"type": "lucene",
"async": [
"async"
],
"evaluatePathRestrictions": true,
"reindex": false,
"reindexCount": 3,
"indexRules": {
"jcr:primaryType": "nt:unstructured",
"nt:base": {
"jcr:primaryType": "nt:unstructured",
"properties": {
"jcr:primaryType": "nt:unstructured",
"sitemapRoot": {
"jcr:primaryType": "nt:unstructured",
"propertyIndex": true,
"name": "sling:sitemapRoot"
}
}
}
}
}

 but nothing change 😞

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
DEBAL_DAS
DEBAL_DASAccepted solution
New Member
Apr 16, 2022 3:59 AM UTC

I have used Sitemap scheduler here and Apache Sling Sitemap - Sitemap Generator Manager is disabled as shown below -

 

 

Generated sitemap is available /var/sitemaps/content/we-retail/us/sitemap.xml on publish instance -

 

 

Debal Das, Senior AEM Consultant

9 replies

DEBAL_DAS
New Member
Apr 15, 2022 12:54 PM UTC

After seeing your post , when I tried I was facing the similar issue. 

I have referred following article: Apache Sling Sitemap for AEM 6.5.11 and AEMaaCs – AEM Queries & Solutions (wordpress.com) and created scheduler configuration at /apps/weretail/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~weretail.cfg.json and published

 

 

Now , I am not getting the above warning in error.log file and here is my sitemap.xml file -

 

 

Hope this will help. Please review.

Translate
Debal Das, Senior AEM Consultant
broman__pl
Level 3
Apr 16, 2022 1:45 AM UTC

Thing is that in your sample site map is generated on demand only. When you disable this option in "Apache Sling Sitemap - Sitemap Generator Manager" you will stop seeing your site map 😞

Sitemaps generated by scheduler should be visible in /var/sitemaps

Translate
broman__pl
Level 3
Apr 20, 2022 4:02 PM UTC

I have used Sitemap scheduler here and Apache Sling Sitemap - Sitemap Generator Manager is disabled as shown below -

 

 

Generated sitemap is available /var/sitemaps/content/we-retail/us/sitemap.xml on publish instance -

 

 


Thanks it is working on publish. Should it work same on author?

Is there any suggested oak index we should apply to avoid those long query warnings?

And on dispatcher we should allow access to paths in /var/sitemaps folder? Like /var/sitemaps/content/we-retail/us/es/sitemap.xml ?

Thanks 🙂

 

Translate
Level 2
Apr 26, 2023 6:11 PM UTC

Hi @broman__pl and @debal_das ,

I'm also facing the same issue. Can you please share details on how these transverse queries got fixed in your case?

*WARN* [sling-default-1-My Scheduler] org.apache.jackrabbit.oak.plugins.index.Cursors$TraversingCursor Traversed 10000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [sling:sitemapRoot] = true and isdescendantnode(a, '/content/we-retail') option(index tag [slingSitemaps]) /* xpath: /jcr:root/content/we-retail//*[@sling:sitemapRoot=true] option(index tag slingSitemaps) */, path=/content/we-retail//*, property=[:indexTag=[slingSitemaps], sling:sitemapRoot=[true]]); consider creating an index or changing the query



I've created scheduler configuration at /apps/weretail/config.publish/org.apache.sling.sitemap.impl.SitemapScheduler~weretail.cfg.json in my publish instance but still I can these warnings in error.log. 

Also, I see that sitemaps are created under var/sitemap folder but http://localhost:4503/content/we-retail/us.sitemap.xml is still not accessible. Is there any other configurations we've to do to make it work?
Regards,
Radha

Translate
Level 4
Jul 9, 2023 8:15 PM UTC

Please use index  if no of node traversal is large, index is now available along with  SP set up and release notes as well

Translate
broman__pl
Level 3
Jul 11, 2023 11:38 PM UTC

is there any link for this?

Translate