Bug in API response: OR in search_query behaves like AND

64 views
Skip to first unread message

ZH Dong

unread,
Nov 13, 2025, 6:55:18 AMNov 13
to arXiv API Discussion

I would like to report a possible bug in the arXiv API related to boolean logic in category queries, which occured to me two days ago (before which all behaviors are normal).

When using the following search_query with multiple categories combined using OR, the API returns only papers that belong to all categories simultaneously (i.e., the intersection), instead of the expected union of categories:

(cat:XXX OR cat:YYY OR cat:ZZZ OR cat:WWW)

Here is one example request that reproduces the issue:

Expected behavior:
Return all papers that belong to any of the listed categories (logical OR).

Actual behavior:
Only papers belonging to all categories simultaneously (logical AND) are returned.
This significantly reduces results and is inconsistent with the documented boolean logic for search_query.


Thank you for your help and for maintaining the arXiv service.

arXiv API Discussion

unread,
Nov 13, 2025, 9:09:26 AMNov 13
to arXiv API Discussion, dz...@mails.tsinghua.edu.cn
Hi DZH,
I'll look into it. 
Thanks for letting us know,
Brian

Brian Maltzan

unread,
Nov 14, 2025, 7:44:47 PMNov 14
to arXiv API Discussion
Hi ZH Dong,

I'm having trouble reproducing the issue.
Maybe there was a temporary server issue, which I do see sometimes.

Right now, this is testing on the previous server:
curl -is http://localhost/api/query\?search_query\=%28cat:cond-mat.supr-con+OR+cat:cond-mat.mtrl-sci%29\&max_results\=20 | grep totalResults
  <opensearch:totalResults xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">145193</opensearch:totalResults>

The new server has different results, but it looks close enough:
curl -is https://export.arxiv.org/api/query\?search_query\=%28cat:cond-mat.supr-con+OR+cat:cond-mat.mtrl-sci%29\&max_results\=20 | grep totalResults
  <opensearch:totalResults>145387</opensearch:totalResults>

Hopefully it's something simple like the max_results parameter?
curl -is https://export.arxiv.org/api/query\?search_query\=%28cat:cond-mat.supr-con+OR+cat:cond-mat.mtrl-sci%29\&max_results\=2000 | wc
   71117

I think it's working correctly, but please let me know I missed something or there are other issues.

Thanks,
Brian
Reply all
Reply to author
Forward
Message has been deleted
0 new messages