Skip to content

Commit

Permalink
Update to lucene 9.2 (#8868)
Browse files Browse the repository at this point in the history
* 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] <support@github.com>

* Update to lucene 92, copy changelog enry

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
  • Loading branch information
dependabot[bot] and Siedlerchr authored May 30, 2022
1 parent 61c5787 commit 3222878
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
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";
}

0 comments on commit 3222878

Please sign in to comment.