presagia-analytics / ctrialsgov

Query Data from ClinicalTrials.gov
https://presagia-analytics.github.io/ctrialsgov/
Other
13 stars 3 forks source link

Unexpected behavior - adding *_kw argument returns smaller trial set #9

Closed kaneplusplus closed 2 years ago

kaneplusplus commented 2 years ago

If I connect and run the following two queries the former returns 26 trials and the second returns 23. Shouldn't the latter return at least as many trials as the first since the set of trials where "g12c" is a keyword in the official title is a subset of the trials where "g12c" keyword in the official title or the description?

ctgov_query(
  study_type = "Interventional",
  sponsor_type = "INDUSTRY",
  official_title_kw = "g12c",
)

ctgov_query(
  study_type = "Interventional",
  sponsor_type = "INDUSTRY",
  description_kw = "g12c",
  official_title_kw = "g12c",
)
kaneplusplus commented 2 years ago

OK, looking at the code, it looks like an intersection of the different keyword argument. The match_all argument says whether all keyword vector arguments need to appear.

Should we consider a union over trials based on *_kw argument?