ahcis-rds / study_finder

StudyFinder is a flexible and configurable application to pull studies from clinicaltrials.gov and augment the data from alternate datasources such as a clinical trials management system.
MIT License
17 stars 4 forks source link

Sort search results by newest studies first #126

Closed cdinger closed 3 years ago

cdinger commented 3 years ago

The search results previously had no explicit ordering. Because we're using match_all queries we dont' get a relevancy score from Elasticsearch.

This change introduces a new column on Trial: added_on. We can't use an existing date (like created_at) because trials can be periodically completely refreshed. Clinicaltrials.gov has a date that seems appropriate for this use (date_first_posted) so we're defaulting to that. This can of course be overridden with dates from other integrating systems like OnCore.

cdinger commented 3 years ago

@johnsja that's the plan. We technically do have a relevance score, but all of the results have the same score. So essentially no deterministic sorting, which is awful. This is a stop-gap.