-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Search in PDF Files #2838
Search in PDF Files #2838
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wooohoooo! Thanks for you efforts to get the PDF search woring!
Just a few initial remarks for now; I will continue reviewing the next days.
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/pdf/search/indexing/DocumentReaderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/pdf/search/indexing/PdfIndexerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments, some unnecessary mocking and some little improvements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nitpicks, it is good to go otherwise
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/pdf/search/indexing/PdfIndexer.java
Outdated
Show resolved
Hide resolved
@@ -211,4 +215,12 @@ public void convertToLocalDatabase() { | |||
public List<BibEntry> getEntries() { | |||
return database.getEntries(); | |||
} | |||
|
|||
public Path getFulltextIndexPath() { | |||
Path appData = Path.of(AppDirsFactory.getInstance().getUserDataDir(JabRefFrame.FRAME_TITLE, SearchFieldConstants.VERSION, "org.jabref")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the documentation at https://github.com/harawata/appdirs. Magic string jabref
is OK for me here.
This fixes #6188 |
Removed empty line and fixed logger format Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Removed unnecessary import
Im still not convinced with using the literal JabRef for index path and would like to talk about that in the call tonight. I wonder, if there isn't a better, more generic solution. |
I agree, especially because it is used in two distinct files and needs to be identical. However, I see how it is also problematic to use the one stored in JabRefFrame. Maybe we should define a new static variable in PdfIndexer? |
For now, lets use highlighted and text annotations only. Fixes 4654
src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java
Outdated
Show resolved
Hide resolved
Result of call - we looked up https://lucene.apache.org/core/8_0_0/core/org/apache/lucene/store/NIOFSDirectory.html
For now, we accept that and think, no issues occur. |
FYI: mac index file is located under /Users/christophs/Library/Application Support/JabRef/0.3a |
Directory is determined using the |
* upstream/main: (45 commits) Squashed 'buildres/csl/csl-styles/' changes from ec4a4c0..176997d (#7910) Update citeproc-java to 3.0.0-alpha.2 (#7911) Search in PDF Files (#2838) Removed references to apache commons logging (#7907) Oobranch c : ootext and rangesort (#7788) Bump jackson-datatype-jsr310 from 2.12.3 to 2.12.4 (#7901) fix markdownlint Bump jackson-dataformat-yaml from 2.12.3 to 2.12.4 (#7899) Bump postgresql from 42.2.22 to 42.2.23 (#7902) Bump classgraph from 4.8.109 to 4.8.110 (#7900) Bump gittools/actions from 0.9.9 to 0.9.10 (#7898) Bump flowless from 0.6.3 to 0.6.4 (#7903) Bump jsoup from 1.13.1 to 1.14.1 (#7904) Bump tika-core from 1.26 to 1.27 (#7897) Try even more empty lines to provoke conflicts in CHANGELOG.md after a release Fix position in CHANGELOG.md Add corporate proxy workaround for Version.getAllAvailableVersions() (#7890) Update to Java 16 in build.gradle (#7892) Preparing Changelog for the next release cycle New development cycle ... # Conflicts: # gradle/wrapper/gradle-wrapper.properties
This implements a fulltext-search feature for linked PDF files.
All linked pdf files are indexed using Apache Lucene. Search-results are displayed in a google-esque fashion in an additional tab in the entry editor (visible only if a fulltext search is active).
Users can enable/disable fulltext-search with a toggle-button in the search-bar.
gradle localizationUpdate
?