From 3222878d0b122868f4617898ab4063745d745cad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 21:22:27 +0200 Subject: [PATCH] Update to lucene 9.2 (#8868) * Bump lucene-queries from 9.1.0 to 9.2.0 Bumps lucene-queries from 9.1.0 to 9.2.0. --- updated-dependencies: - dependency-name: org.apache.lucene:lucene-queries dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update to lucene 92, copy changelog enry Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Siedlerchr --- CHANGELOG.md | 5 +++++ build.gradle | 10 +++++----- src/main/java/module-info.java | 2 +- .../jabref/logic/pdf/search/retrieval/PdfSearcher.java | 2 -- .../jabref/model/pdf/search/SearchFieldConstants.java | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b1ea86593c..a29e61ab839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/build.gradle b/build.gradle index aadf4d2a33b..5c617dc0d28 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index ca408a86348..751863df3e1 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -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; diff --git a/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java b/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java index d0b7f8d3e2a..2fd7e54e5b0 100644 --- a/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java +++ b/src/main/java/org/jabref/logic/pdf/search/retrieval/PdfSearcher.java @@ -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; @@ -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 { diff --git a/src/main/java/org/jabref/model/pdf/search/SearchFieldConstants.java b/src/main/java/org/jabref/model/pdf/search/SearchFieldConstants.java index 82da59322c4..a42baead1b6 100644 --- a/src/main/java/org/jabref/model/pdf/search/SearchFieldConstants.java +++ b/src/main/java/org/jabref/model/pdf/search/SearchFieldConstants.java @@ -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"; }