arXiv search returns nothing for terms with accented characters
What happens
Any arXiv search containing an accented character returns no results.
ArXivFetcher.callApi strips accents from the query before sending it:
// The arXiv API has problems with accents, so we remove them (i.e. Fréchet -> Frechet)
uriBuilder.addParameter("search_query", StringUtil.stripAccents(searchQuery));
That comment is no longer accurate. arXiv matches only the accented form, so stripping guarantees zero results:
sent to export.arxiv.org |
results |
|---|---|
ti:"slice theorem for Fr%C3%A9chet" (UTF-8) |
1 |
ti:"slice theorem for Frechet" (what JabRef sends) |
0 |
ti:"slice theorem for Fr%E9chet" (Latin-1) |
0 |
URIBuilder already percent-encodes the parameter as UTF-8, so no encoding step is missing — the term is simply altered before it is sent.
How to reproduce
./gradlew :jablib:fetcherTest --tests "*ArXivFetcherTest*"
searchEntryByPartOfTitleWithAcuteAccent fails with expected: <[...]> but was: <[]> — an empty result list rather than a different entry.
Second, separate problem in the same test
With the accent stripping removed, the search returns the correct paper and the assertion then fails only on the citation key:
- expected
@article{Diez:2013fdp, - actual
@article{https://doi.org/10.48550/arxiv.1405.2249,
That comes from infuseWithInspireCitationKeyIfMissing. INSPIRE still serves the expected key — GET https://inspirehep.net/api/arxiv/1405.2249?fields=texkeys returns ["Diez:2013fdp", "Diez:2014ppa"] — and INSPIREFetcherTest passes 3/3, so the fetcher itself is fine; the lookup made from ArXivFetcher is what comes back empty. Its FetcherClientException branch logs at TRACE, so the miss is silent.
I have not root-caused that second one and am not claiming to.
JabRef version
main at 939f392, run locally on macOS with JDK 21.
AI usage
Claude Code (model claude-opus-5), used to run the fetcher tests, read the failure report, and query the arXiv and INSPIRE APIs. AIL3 — AI-assisted, human-directed and human-owned.
/assign
/assign-me
👋 Hey @esthermichelle, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
⏰ Assignment Reminder
Hi @esthermichelle, this is a friendly reminder about your assignment to this issue.
[!WARNING] This issue will be automatically unassigned in 4 days if there's no activity.
Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.
How to keep your assignment
If you are working on it, you can prevent automatic unassignment by:
- Submitting a draft pull request with your progress within 4 days
- Asking for the 📌 Pinned label if you need more time
We appreciate your contribution and are here to help if needed!
📋 Assignment Update
Hi @esthermichelle, due to inactivity, you have been unassigned from this issue.
Next steps
If you still want to work on this:
- Submit a pull request showing your current state. You will be automatically assigned again.
- Ask a maintainer to assign you again.
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 2 pull request(s) of which 50% (1/2) have been merged.
I tried to reproduce the problem, but I think this issue may have already been resolved by #16825.
/unassign-me
@vsmottin has been unassigned from this issue.
/assign-me
👋 Hey @kushagra31-coder, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly. When using AI tools, please use them as an assistant rather than simply copying their output. See Don't paste the AI, please.. For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
Verified on current main: this was already fixed by #16825 (merged Sep 4), which removed the stripAccents call from ArXivFetcher.callApi and closed #16477 for the same bug. The regression test (searchEntryByPartOfTitleWithAcuteAccent) passes against the live arXiv API. Safe to close as resolved by #16825. /unassign-me
@kushagra31-coder has been unassigned from this issue.
/assign-me
👋 Hey @u7899091, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly. When using AI tools, please use them as an assistant rather than simply copying their output. See Don't paste the AI, please.. For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
Fixed by #16825 (merged Sep 4): ArXivFetcher.callApi now sends the query without stripping accents. Closing.
Hi, I'm picking up the second problem in this issue, the citation key. The accent stripping was fixed in #16825, but the citation key part doesn't seem to have been.
Root cause. I believe ArXivFetcher.infuseWithInspireCitationKeyIfMissing (added in #16235) is only called from performSearchById. Text and query searches go through performSearchPaged / performRawSearchQueryPaged → enrichPageWithDoi, which only merges DOI metadata, so the entry keeps the arXiv DOI URL as its key. The INSPIRE lookup isn't failing silently, it's never made on that path.
Evidence. For arXiv 1405.2249, on unmodified main, I added this scratch test:
@Test
void scratchCompareCitationKeyByIdVersusBySearch() throws FetcherException {
Optional<String> keyById = fetcher.performSearchById("1405.2249")
.flatMap(BibEntry::getCitationKey);
Optional<String> keyBySearch = fetcher.performSearch("title=\"slice theorem for Fréchet\"")
.getFirst()
.getCitationKey();
System.out.println("KEY BY ID: " + keyById.orElse("<none>"));
System.out.println("KEY BY SEARCH: " + keyBySearch.orElse("<none>"));
assertEquals(keyById, keyBySearch);
}
Output of ./gradlew :jablib:externalServicesTest --tests "*ArXivFetcherTest*scratchCompareCitationKeyByIdVersusBySearch*" -i:
KEY BY ID: Diez:2013fdp
KEY BY SEARCH: https://doi.org/10.48550/arxiv.1405.2249
searchEntryByPartOfTitleWithAcuteAccent currently asserts the DOI URL key, which is why it passes.
Proposed fix. Call infuseWithInspireCitationKeyIfMissing in enrichPageWithDoi, after the DOI infusion in ArXivFetcher.java, and update the test's expected key to Diez:2013fdp. One concern: a page of N results now makes up to N extra INSPIRE requests. Is that acceptable?
Should I open a PR referencing this issue, or a new issue? Happy to follow whichever you prefer.
AI usage: Claude Code (model claude-sonnet-5-5) located the root cause; I investigated the issue and reviewed the root cause, reproducing the findings myself.
@CongyuLiu09 opened #17652 for this issue without being assigned. @u7899091: this does not affect your assignment.