Web-based Search supports web-fetcher syntax#15249
Conversation
…oute DOI queries to IDBasedFetcher bypassing ANTLR parsing
Review Summary by QodoWeb search supports fetcher-specific syntax and DOI routing
WalkthroughsDescription• Web search now accepts fetcher-specific syntax instead of rejecting it • DOI queries automatically route to IdBasedFetcher bypassing ANTLR parsing • Invalid queries fall back to raw search terms sent to fetchers • UI validation changed from error to warning for non-standard syntax Diagramflowchart LR
A["Search Query Input"] --> B{"Is DOI?"}
B -->|Yes & IdBasedFetcher| C["Route to IdBasedFetcher"]
B -->|No| D{"Valid ANTLR?"}
D -->|Yes| E["Parse with SearchQueryVisitor"]
D -->|No| F["Fall back to Raw Term"]
E --> G["Perform Search"]
C --> G
F --> G
File Changes1. jabgui/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java
|
Code Review by Qodo
1.
|
This comment has been minimized.
This comment has been minimized.
|
I still have to implement the UI mode indicator and also I noticed (koppor/jabref#559) centralizes query interpretation into a FetcherDelegator class. Right now my changes duplicate the parse then fallback logic in both SearchBasedFetcher and PagedSearchBasedFetcher. Should this be extracted into a shared utility/delegator as part of this PR or is that a larger refactor that should be handled separately? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Your pull request conflicts with the target branch. Please merge with your code. For a step-by-step guide to resolve merge conflicts, see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-using-the-command-line. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| modeIndicator.textProperty().bind(viewModel.searchModeIndicatorProperty()); | ||
| modeIndicator.managedProperty().bind(modeIndicator.visibleProperty()); | ||
| modeIndicator.visibleProperty().bind(modeIndicator.textProperty().isNotEmpty()); | ||
| modeIndicator.setStyle("-fx-font-size: 0.85em; -fx-text-fill: -fx-mid-text-color;"); |
There was a problem hiding this comment.
No direct style in javafx. Put everything into base.css and use styleclasses instead
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: 99e09e4 Learn more about TestLens at testlens.app. |
Related issues and pull requests
Closes #12637
PR Description
This covers mainly the fundamental back end part of the issue but not the UI mode display yet. Previously, entering a fetcher specific syntax like pica.tit = quantum into the web search bar would throw an "Invalid Query" error because the ANTLR parser didn't recognize it. Now DOI outputs are detected and routed to IdBasedFetcher and queries that fail that ANTLR parsing fall back to a raw search term instead of being rejected. I've also changed the UI validation from an error to a warning so it doesn't block the user from searching.
Steps to test
Before :

After :

Here's a rough sketch on how the flow works
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)