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

Fix typeahead search suggestions #97

Closed cdinger closed 3 years ago

cdinger commented 3 years ago

This was mostly just a routing problem. When the study show route was added, it started snatching up requests to /studies/typeahead. I also took the opportunity to push the complexity of the suggestions structure up into the Trial model. Trial.typeahead will now just returns an array of strings instead of the raw Elasticsearch response.

This fix makes the typeahead javascript work again, but the there's still a lot of room for improvement in the quality of suggestions we're getting. This is just step 1.