0

Can you explain the difference between searching on OpenFDA with the .exact suffix, and without the suffix? I'm a little confused

1 Answer 1

0

We sure can. Fields that permit an .exact suffix have been indexed in two forms in the openFDA database (which uses Elasticsearch). A field without the .exact suffix has been tokenized to allow flexible partial searches. For example, consider the following query: https://api.fda.gov/drug/ndc.json?search=brand_name:Advil&limit=1000. This will return all NDC drugs that contain Advil within their brand name, such as CHILDRENS ADVIL,ADVIL MIGRAINE, and so on.

Now try adding the suffix as follows: https://api.fda.gov/drug/ndc.json?search=brand_name.exact:Advil&limit=1000. You will see fewer results, and each result will have its brand_name exactly that: Advil. Exact value match is now required.

Hope this makes sense.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.