cernopendata / opendata.cern.ch

Source code for the CERN Open Data portal
http://opendata.cern.ch/
GNU General Public License v2.0
665 stars 148 forks source link

search: most recent news #3095

Closed tiborsimko closed 11 months ago

tiborsimko commented 3 years ago

The most recent news link is displayed on the home page. It is currently not giving the most recent order, see:

https://opendata-dev.cern.ch/search?q=&f=type%3ANews&l=list&order=asc&p=1&s=10&sort=mostrecent

What we should do is to order the news by the created field that all records have:

$ grep created cernopendata/modules/fixtures/data/docs/*/*.json                                                                                
cernopendata/modules/fixtures/data/docs/alice-releases-educational-datasets-2014/alice-releases-educational-datasets-2014.json:    "created": "2014-11-20",
cernopendata/modules/fixtures/data/docs/atlas-13tev-open-data-release-2020/atlas-13tev-open-data-release-2020.json:      "created": "2020-02-11",
cernopendata/modules/fixtures/data/docs/atlas-higgs-machine-learning-challenge-2015/atlas-higgs-machine-learning-challenge-2015.json:    "created": "2015-02-17",
cernopendata/modules/fixtures/data/docs/atlas-open-data-resources-2016/atlas-open-data-resources-2016.json:    "created": "2016-07-29",
cernopendata/modules/fixtures/data/docs/cern-open-data-policy-for-lhc-experiments/cern-open-data-policy-for-lhc-experiments.json:    "created": "2020-12-11",
cernopendata/modules/fixtures/data/docs/cms-completes-2010-2011-pp-data/cms-completes-2010-2011-pp-data.json:    "created": "2020-08-27",
cernopendata/modules/fixtures/data/docs/cms-observing-higgs-2017/cms-observing-higgs-2017.json:    "created": "2017-12-20",
cernopendata/modules/fixtures/data/docs/cms-releases-first-batch-of-data-2014/cms-releases-first-batch-of-data-2014.json:    "created": "2014-11-20",
cernopendata/modules/fixtures/data/docs/cms-releases-heavy-ion-data/cms-releases-heavy-ion-data.json:    "created": "2020-12-21",
cernopendata/modules/fixtures/data/docs/cms-releases-new-batch-of-data-2016/cms-releases-new-batch-of-data-2016.json:    "created": "2016-04-22",
cernopendata/modules/fixtures/data/docs/cms-releases-open-data-for-machine-learning-2019/cms-releases-open-data-for-machine-learning-2019.json:    "created": "2019-07-18",
cernopendata/modules/fixtures/data/docs/cms-summer-student-report-2017/cms-summer-student-report-2017.json:    "created": "2017-11-15",
cernopendata/modules/fixtures/data/docs/cms-the-future-is-open-2017/cms-the-future-is-open-2017.json:    "created": "2017-12-01",
cernopendata/modules/fixtures/data/docs/cod-welcome/cod-welcome.json:    "created": "2017-12-18",
cernopendata/modules/fixtures/data/docs/opera-news-first-release/opera-news-first-release.json:    "created": "2018-05-22",
cernopendata/modules/fixtures/data/docs/opera-releases-charm-nue-samples-2020/opera-releases-charm-nue-samples-2020.json:    "created": "2020-05-20",

Note that this concerns "News" articles only.

psaiz commented 1 year ago

I'm a bit confused. The link in the description has order=asc&...sort=mostrecent. If we want the most recent news first, shouldn't it be order=desc ?

tiborsimko commented 1 year ago

I guess "most recent" has a clear meaning and the order=desc bit is not really user selectable in the web interface -- it only appears in the URL. So we can indeed go for either "asc" or "desc", depending on how the indexes are constructed, provided that the search page really gives the latest news first...

psaiz commented 11 months ago

Starting from the home page, go to news -> more, it looses the filter of 'News', and make sure that the order is correct