diff --git a/lib/services/sitemaps.js b/lib/services/sitemaps.js index 335f3b0..0b70678 100644 --- a/lib/services/sitemaps.js +++ b/lib/services/sitemaps.js @@ -123,7 +123,9 @@ function streamNewsEntries(site) { scroll: '10s', size: '50', body: { - sort: [{lastmod: 'desc'}], + sort: [{ + 'news:news.news:publication_date': 'desc' + }], query: { bool: { filter: [{ diff --git a/lib/services/sitemaps.test.js b/lib/services/sitemaps.test.js index e47431b..2b13524 100644 --- a/lib/services/sitemaps.test.js +++ b/lib/services/sitemaps.test.js @@ -251,7 +251,7 @@ describe(_.startCase(filename), function () { expect(results).to.eql(mockDocs); expect(elasticOpts.index).to.equal('news-sitemap-entries'); expect(elasticOpts.body.sort).to.include({ - lastmod: 'desc' + 'news:news.news:publication_date': 'desc' }); expect(elasticOpts.body.query.bool.filter).to.include( {term: {site: 'wwwthecut'}}