Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to search doi directly in web search #9674

Closed
2 tasks done
Turgon-Aran-Gondolin opened this issue Mar 16, 2023 · 9 comments · Fixed by #9969
Closed
2 tasks done

Unable to search doi directly in web search #9674

Turgon-Aran-Gondolin opened this issue Mar 16, 2023 · 9 comments · Fixed by #9969
Assignees
Labels
fetcher good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@Turgon-Aran-Gondolin
Copy link

Turgon-Aran-Gondolin commented Mar 16, 2023

JabRef version

5.9 (latest release)

Operating system

Windows

Details on version and operating system

Windows 10 22H2

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Turn on web search panel, select INSPIRE for example
  2. search a doi, i.e. 10.1007/JHEP02(2023)082 without using quotes
  3. the search failed with an unhandled exception.
  4. The exception goes away if surround the doi with quotes

Appendix

I think the problem is that the search box is unable to handle the slash "/". Either escaping "/" or adding quotes would solve it. But a more general solution is preferred.
...

Log File
org.jabref.logic.importer.FetcherException: An error occurred when parsing the query
	at org.jabref@5.10.236/org.jabref.logic.importer.SearchBasedFetcher.performSearch(Unknown Source)
	at org.jabref@5.10.236/org.jabref.gui.importer.fetcher.WebSearchPaneViewModel.lambda$search$3(Unknown Source)
	at org.jabref@5.10.236/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
	at org.jabref@5.10.236/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.10.236/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

@Siedlerchr
Copy link
Member

Yes this is a known issue. For identifiers like DOI you can directly paste them directly on the main table or use this dialog
grafik

Or the general new entry dialog

@HoussemNasri
Copy link
Member

This is because the search query needs to adhere to Lucene query syntax.

@Turgon-Aran-Gondolin
Copy link
Author

Yes this is a known issue. For identifiers like DOI you can directly paste them directly on the main table or use this dialog grafik

Or the general new entry dialog

Thanks for your reply. I would prefer using a particular database, so that's why I was using the web search. There're workarounds, of course. Worst-case scenario, I need to spend an extra 5 seconds to escape the slash. It would be nice if jabref can support this generically though, but if it's too complicated to implement, I can live with workarounds.

@ThiloteE
Copy link
Member

Is this issue something that theoretically can be fixed if somebody would just start doing it or is it legit impossible and we should put label "status: won't fix"?

@koppor
Copy link
Member

koppor commented Apr 24, 2023

Screenshot of the issue:

image

As first "fix": If the thing is a DOI, ignore the selected search engine and do the DOI search.

@koppor koppor added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Apr 24, 2023
@github-project-automation github-project-automation bot moved this to Free to take in Good First Issues Apr 24, 2023
@JabRef JabRef deleted a comment from koppor Apr 24, 2023
@Siedlerchr
Copy link
Member

Codewise the starting found would be:

public WebSearchPaneViewModel(PreferencesService preferencesService, DialogService dialogService, StateManager stateManager) {

  1. Check if the entered text is a DOI (see e.g. DOI.parse in performSearchById in CompositeIDFetcher)
  2. If yes -> Search DOI else search normal text for the selected fetcher

@koppor
Copy link
Member

koppor commented Apr 27, 2023

This is a part of issue #7575.

Proposal:

  1. Fix DOI entering (as wished here)
  2. Fix entering any ID (as wished at Entering an Id at the Web Search should search for the id - and not throw an Exception #7575) - and possible in the quick fetcher (Unable to search doi directly in web search #9674 (comment))

@aqurilla
Copy link
Contributor

aqurilla commented Jun 1, 2023

I would like to take up this issue

@ThiloteE ThiloteE moved this from Free to take to Reserved in Candidates for University Projects Jun 1, 2023
@ThiloteE ThiloteE moved this from Free to take to Reserved in Good First Issues Jun 1, 2023
@ThiloteE
Copy link
Member

ThiloteE commented Jun 1, 2023

Cool, thanks @aqurilla 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetcher good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants