search for subject field results in more hits than shown on website

20 views
Skip to first unread message

Tony Berber-Sardinha

unread,
Apr 8, 2020, 11:15:58 AM4/8/20
to PLOS API Developers
Dear members

I've run this query to get all the article IDs for 'Veterinary science':


this returns 3284 hits:

{
  "response":{"numFound":3284,"start":1,"docs":[]
  }}

But the count of articles for 'Veterinary science' on the website is less: 995.


Is there something wrong with my query?

thank you ahead

tony

Erik Hetzner

unread,
Apr 9, 2020, 1:57:28 PM4/9/20
to plos-api-...@googlegroups.com, Tony Berber-Sardinha
Dear Tony,

Thanks for the query! There are two changes that should get you what you want. First, it should be `subject:` not `subject=`, though I’m not sure what difference that will make.

Second, you want to filter by `doc_type:full`, because we index sub-documents.

Third, you want to filter by journal. There are a number of ways to do this, but `journal_id_pmc:plosone` is a good one.

So here is your final query:

curl "http://api.plos.org/search?q=subject:%22Veterinary%20science/%22+and+doc_type:full+and+journal_id_pmc:plosone&fl=id&start=1&rows=0"

which returns 997 entries.

Please let us know any other questions you have!

best, Erik
> --
> You received this message because you are subscribed to the Google Groups "PLOS API Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> plos-api-develo...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/plos-api-developers/22ace74c-5777-4e59-9907-b0cf843082d5%40googlegroups.com.

🐝 PLOS | OPEN FOR DISCOVERY
🐘 Erik Hetzner | Software Developer | he, him
📮 1160 Battery Street, Suite 225, San Francisco, CA 94111
📞 Main +1 415 624 1200

Tony Berber Sardinha

unread,
Apr 9, 2020, 2:13:22 PM4/9/20
to Erik Hetzner, plos-api-...@googlegroups.com
Dear Erik

thank you for your reply and for explaining these changes. The query now works perfectly. And thank you all at PLOS ONE for making this resource available to all!

Tony Berber Sardinha
Director, Graduate Program in Applied Linguistics
Sao Paulo Catholic University
http://lael.pucsp.br
Reply all
Reply to author
Forward
0 new messages