NCIOCPL / drug-dictionary-api

NCI Drug Dictionary API
0 stars 3 forks source link

Autosuggest Contains does not return desired result #42

Closed seyilonge-nci closed 3 years ago

seyilonge-nci commented 3 years ago

Issue description

When an Autosuggest query is run with Contains match type, the expected result is not returned

ESTIMATE TBD

Steps to reproduce the issue

  1. https://webapis.cancer.gov/drugdictionary/v1/Autosuggest?searchText=3-0&matchType=Contains&includeResourceTypes=DrugAlias&size=10

  2. No results returned

What's the expected result?

What's the actual result?

-

Additional details / screenshot

Related Tickets

blairlearn commented 3 years ago

For the drug API, Elasticsearch is configured to not treat dashes as delimiters. This is a deliberate difference from the glossary API, owing to the fact that drug names contain a lot of punctuation.

Contains searches look for matches at word boundaries. Because we're not treating the dash as a delimiter, the "3-0" in "13-hydroxy-3-0x0-13,17-secoandrosta-1,4-dien-17-oic acid delta-lactone" is not seen as occurring on a word boundary and is therefore not seen as a match.