Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: most recent news #3095

Closed
tiborsimko opened this issue Mar 1, 2021 · 3 comments · Fixed by #3484
Closed

search: most recent news #3095

tiborsimko opened this issue Mar 1, 2021 · 3 comments · Fixed by #3484
Assignees

Comments

@tiborsimko
Copy link
Member

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.

wahaj added a commit to wahaj/opendata.cern.ch that referenced this issue Nov 22, 2021
* Gets the most recent news articles when calling the search API with a 'mostrecent'
  argument

* Closes cernopendata#3095
@psaiz psaiz self-assigned this Nov 3, 2023
@psaiz
Copy link
Contributor

psaiz commented Nov 3, 2023

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
Copy link
Member Author

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
Copy link
Contributor

psaiz commented Dec 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants