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

Update to lucene 9.2 #8868

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Changed

- We upgraded to Lucene 9.2 for the fulltext search.
Thus, the now created search index cannot be read from older versions of JabRef anylonger.
⚠️ JabRef will recreate the index in a new folder for new files and this will take a long time for a huge library.
Moreover, switching back and forth JabRef versions and meanwhile adding PDFs also requires rebuilding the index now and then.
[#8868](https://github.com/JabRef/jabref/pull/8868)
- We improved the Latex2Unicode conversion [#8639](https://github.com/JabRef/jabref/pull/8639)
- Writing BibTeX data into a PDF (XMP) removes braces. [#8452](https://github.com/JabRef/jabref/issues/8452)
- Writing BibTeX data into a PDF (XMP) does not write the `file` field.
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ dependencies {
implementation 'org.apache.pdfbox:fontbox:3.0.0-RC1'
implementation 'org.apache.pdfbox:xmpbox:3.0.0-RC1'

implementation 'org.apache.lucene:lucene-core:9.1.0'
implementation 'org.apache.lucene:lucene-queryparser:9.1.0'
implementation 'org.apache.lucene:lucene-queries:9.1.0'
implementation 'org.apache.lucene:lucene-analysis-common:9.1.0'
implementation 'org.apache.lucene:lucene-highlighter:9.1.0'
implementation 'org.apache.lucene:lucene-core:9.2.0'
implementation 'org.apache.lucene:lucene-queryparser:9.2.0'
implementation 'org.apache.lucene:lucene-queries:9.2.0'
implementation 'org.apache.lucene:lucene-analysis-common:9.2.0'
implementation 'org.apache.lucene:lucene-highlighter:9.2.0'

implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.9.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
// fulltext search
requires org.apache.lucene.core;
// In case the version is updated, please also adapt SearchFieldConstants#VERSION to the newly used version
uses org.apache.lucene.codecs.lucene91.Lucene91Codec;
uses org.apache.lucene.codecs.lucene92.Lucene92Codec;

requires org.apache.lucene.queryparser;
uses org.apache.lucene.queryparser.classic.MultiFieldQueryParser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.jabref.model.pdf.search.SearchResult;
import org.jabref.model.strings.StringUtil;

import org.apache.lucene.codecs.Codec;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.queryparser.classic.MultiFieldQueryParser;
Expand All @@ -36,7 +35,6 @@ public final class PdfSearcher {

private PdfSearcher(Directory indexDirectory) {
this.indexDirectory = indexDirectory;
Codec.forName("Lucene91");
}

public static PdfSearcher of(BibDatabaseContext databaseContext) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public class SearchFieldConstants {

public static final String[] PDF_FIELDS = new String[]{PATH, CONTENT, PAGE_NUMBER, MODIFIED, ANNOTATIONS};

public static final String VERSION = "lucene91";
public static final String VERSION = "lucene92";
}