TheJacksonLaboratory / PhenopacketLab

An Angular/Springboot web application for the loading, editing, saving of data that follows the Phenopacket Schema
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Make sure the backend returns a sorted list of first 10 terms (on ids) #232

Closed belkassaby closed 1 year ago

belkassaby commented 1 year ago

When searching for hypertension, it doesnt come up in the first 10 results provided by the backend as it seems the resuts are not sorted before picking the first 10 and sending it to the frontend.

BethSundberg commented 1 year ago

This has been fixed nicely for the phenotypic features search. But the diseases search has not been changed. @belkassaby can you change this also for the diseases search so they work the same?

belkassaby commented 1 year ago

It does a sort but it is a sort on the ids: indeed, when I first do the sort, it is on the whole list of features : so If I search for "hypertension" all the names/labels which start with letters before " H" like "Episodic hypertension" will come up in the sorted list before hypertension. WHereas, when i sort by the ids, (HP:1234), the terms with lower ids are usually the simpler ones too. Meaning hypertension will have a lower id than "episodic hypertension". The main thing here is that in the ten results provided by the backend, we need to show the term that is typed as a possible item selection . The same for the diseases

BethSundberg commented 1 year ago

This is working for phenotypic features, so I will close this. I am going to add an enhancement to make the search work this same way for diseases and cause of death.