incubator-stormcrawler icon indicating copy to clipboard operation
incubator-stormcrawler copied to clipboard

Redirected sitemaps in SiteMapParserBolt / SiteMapFilter

Open mvolikas opened this issue 2 years ago • 1 comments

Hi!

When the SiteMapParserBolt processes a redirected sitemap that contains links (see for example http://sample-sitemap.xml), the isSitemapKey is added only after the outlinks have been processed. If the SiteMapFilter is also enabled, then all the links are filtered out since the SiteMapParserBolt.isSitemapKey is false. This is fixed when the metadata.setValue(isSitemapKey, "true") is moved before the outlinks processing.

Also, the sniff method returns false for some sitemaps, because of the small maxOffsetGuess. For example, for this sitemap. This can be fixed by increasing sitemap.offset.guess, however, this might impact performance.

Should I create a PR with the fix for SiteMapParserBolt? Should I take a shot at a different (efficient) way of "sniffing" a possible sitemap format?

Thanks, Markos

mvolikas avatar May 17 '24 13:05 mvolikas

Feel free to provide a PR with a fix. We can follow up with a more efficient approach in an additional PR. WDYT?

rzo1 avatar May 17 '24 13:05 rzo1