logical-operatorspubmedpubmed-api

PubMed query: priority of operations using parenthesis leads to zero results


I am using the easyPubMed package in R, but I think this applies to PubMed generally, for example using the website interface (which is perhaps simpler for debugging since we know the R package is not at fault). When determining the order of priority with parentheses, it seems there is a conflict with parentheses for journal names (when it shouldn't affect anything).

For example, the query below returns no results:

(Developmental psychology [Journal] OR Journal of economic growth (Boston, Mass.) [Journal]) 
AND ('2000/01/01' [Date - Publication] : '2000/12/31' [Date - Publication]')

enter image description here

But if we remove the parenthesis (Boston, Mass.), then we get 68 results:

(Developmental psychology [Journal] OR Journal of economic growth [Journal]) 
AND ('2000/01/01' [Date - Publication] : '2000/12/31' [Date - Publication])

enter image description here

If it is using an OR operator, if a specific journal is not found, it should not lower the total number of results, no? Any explanation or workaround for this?


Solution

  • The solution is to use quotes for journal names that include parentheses, so that they are considered only as names so as to avoid conflict with parentheses meant to indicate priority of operations. Therefore, the revised query would be:

    ("Developmental psychology" [Journal] OR "Journal of economic growth (Boston, Mass.)" [Journal]) 
    AND ("2000/01/01" [Date - Publication] : "2000/12/31" [Date - Publication]")
    

    This provides the expected 68 results.

    Edit: to prevent further problems, double quotes should be used instead of single quotes. The example was updated to this effect.