Skip to content
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
2 changes: 1 addition & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

// region: Lucene
/**
* In case the version is updated, please also adapt {@link org.jabref.model.search.SearchFieldConstants#VERSION} to the newly used version.
* In case the version is updated, please also increment {@link org.jabref.model.search.SearchFieldConstants#VERSION} to trigger reindexing.
*/
uses org.apache.lucene.codecs.lucene99.Lucene99Codec;
requires org.apache.lucene.analysis.common;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ private void onClosed(Event event) {
LOGGER.error("Problem when closing directory monitor", e);
}
try {
luceneManager.close();
if (luceneManager != null) {
luceneManager.close();
}
} catch (RuntimeException e) {
LOGGER.error("Problem when closing lucene indexer", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected TokenStreamComponents createComponents(String fieldName) {
result = new StopFilter(result, EnglishAnalyzer.ENGLISH_STOP_WORDS_SET);
result = new ASCIIFoldingFilter(result);
result = new LowerCaseFilter(result);
result = new EdgeNGramTokenFilter(result, minGram, maxGram, true);
result = new EdgeNGramTokenFilter(result, minGram, maxGram, true);
return new TokenStreamComponents(source, result);
}
}
10 changes: 8 additions & 2 deletions src/main/java/org/jabref/model/search/SearchFieldConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
import org.apache.lucene.analysis.en.EnglishAnalyzer;

public enum SearchFieldConstants {

VERSION("99"),
/**
* Version number for the search index.
* Increment when:
* 1. Index changes require reindexing (e.g., new/removed/renamed fields, analyzer changes)
* 2. Lucene codec changes (see module-info.java Lucene section)
* Incrementing triggers reindexing.
*/
VERSION("1"),
DEFAULT_FIELD("any"),
ENTRY_ID("id"),
ENTRY_TYPE("entrytype"),
Expand Down