Issue
- Sitemap should not generate with more than 50,000 entries or 50 MB in size (this is Google standard).
- Steps to reproduce:
- Run the following Groovy script:
def company = com.liferay.portal.kernel.util.PortalUtil.getCompany(actionRequest);
long companyId = company.getCompanyId();
def user = com.liferay.portal.kernel.util.PortalUtil.getUser(actionRequest);
long userId = user.getUserId();
def guestGroup = com.liferay.portal.kernel.service.GroupLocalServiceUtil.getGroup(companyId, com.liferay.portal.kernel.model.GroupConstants.GUEST);
def groupId = guestGroup.getGroupId();
def type = com.liferay.portal.kernel.model.LayoutConstants.TYPE_PORTLET;
def serviceContext = new com.liferay.portal.kernel.service.ServiceContext();
def pagePrefix = "my-layout-";
for (int i = 1; i <= 50001; i++) {
def name = pagePrefix + i;
def title = name;
def description = name;
def friendlyURL = "/" + name;
com.liferay.portal.kernel.service.LayoutLocalServiceUtil.addLayout(userId, groupId, false, com.liferay.portal.kernel.model.LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, name, title, description, type, false, false, friendlyURL, serviceContext);
} -
When finished, download the sitemap.xml file from http://localhost:8080/sitemap.xml.
-
Executed the shell command:
grep -o '<loc>' sitemap.xml | wc -l
- Check the value obtained by the command executed previously
Expected behaviour:The value is 50,000, and the newest entries are present.
Actual behaviour:
The value is 50,002
Environment
- Liferay DXP 7.1
Resolution
- The observed behavior is a known bug addressed by the LPSA-55887 and has already been included in 7.1.10.5 SP5 .