NCATS-Tangerine / translator-knowledge-beacon

NCATS Translator Knowledge Beacon Application Programming Interface plus Sample code
MIT License
7 stars 2 forks source link

Search specification: favour exact keyword matches. #24

Open lhannest opened 6 years ago

lhannest commented 6 years ago

When searching for concepts, exact matches are mixed in with matches that contain the search term, including matches with the search term in the middle of a word. This can cause the search results to have low relevance. One example is that when searching for "liver," the 1st result is "Drug Delivery Systems," the 4th result is "Liver dysfunction," and "Liver" doesn't appear until the 3rd page.

We need to be more clear about what beacons are supposed to do when they execute searches. The order could work like this:

  1. Results whose names exactly match the search phrase come first, e.g. if you type in "diabetes mellitus" and there is a concept with the name "diabetes mellitus", then that concept would come before "diabetes" or "gestational diabetes mellitus".
  2. Results whose names exactly match a term in the search phrase come second. So if you search "liver" then "liver disfunction" should come before "Drug Delivery Systems"
  3. Then, results whose description or definition exactly match a term in the search phrase come third.
  4. Then, finally, any other hit can follow. It's acceptable that "Drug Delivery Systems" would appear for "liver", as long as it comes after anything relevant to the liver.

Also all keyword matches should be caseless. "diabetes mellitus" should match "Diabetes Mellitus".