Skip to content

Commit

Permalink
Sort news sitemap by published date rather than lastmod (#73)
Browse files Browse the repository at this point in the history
* Sorts news sitemap by published date rather than lastmod

* Fixes test
  • Loading branch information
cperryk authored Mar 26, 2018
1 parent ef6aa20 commit fc99387
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/services/sitemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down
2 changes: 1 addition & 1 deletion lib/services/sitemaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}}
Expand Down

0 comments on commit fc99387

Please sign in to comment.