apache slign sitemap oak index | Community
Skip to main content
broman__pl
Level 3
April 14, 2022
Solved

apache slign sitemap oak index

  • April 14, 2022
  • 2 replies
  • 4866 views

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.
Best answer by DEBAL_DAS

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 -

 

 

2 replies

DEBAL_DAS
New Member
April 15, 2022

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.

Debal Das, Senior AEM Consultant
broman__pl
Level 3
April 16, 2022

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

DEBAL_DAS
DEBAL_DASAccepted solution
New Member
April 16, 2022

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
Level 2
April 26, 2023

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

Level 4
July 9, 2023

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

broman__pl
Level 3
July 11, 2023

is there any link for this?