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

Lucene search backend #8963

Closed
wants to merge 111 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
972bac7
Cleanup index when opening a library
btut Jul 9, 2022
dd81c9e
Changelog
btut Jul 9, 2022
f0c7039
Remove debug output
btut Jul 9, 2022
4e49146
Refractor to prepare for full lucene-search-backend
btut Jul 9, 2022
4c40de6
Fix infinite recursion
btut Jul 9, 2022
59047f1
Implement lucene search backend
btut Jul 9, 2022
be31a62
Consider fulltext-index-preference
btut Jul 9, 2022
e88d5d0
Better status-reporting for re-indexing on preference change
btut Jul 9, 2022
ccad245
Fix tests
btut Jul 9, 2022
6ad3c2a
Prioritize BibEntry field changes
btut Jul 9, 2022
21927c1
Prepare CHANGELOG.md
koppor Jul 10, 2022
b78d3fe
Trigger lucene-search in gui and display scoring
btut Jul 10, 2022
780f1a4
Merge branch 'version6' into luceneSearchBackend
btut Jul 10, 2022
d59d528
Don't prefix fields that users should be able to search in
btut Jul 10, 2022
006b828
Matches in bib-fields should score higher than fulltext-matches
btut Jul 12, 2022
b19be22
Refactoring
btut Aug 15, 2022
b89714a
Change file-icon if search yielded a fulltext-result
btut Aug 15, 2022
3cf15d1
Merge branch 'main' into version6
btut Aug 15, 2022
6711b40
Merge branch 'version6' into luceneSearchBackend
btut Aug 15, 2022
a9f0e75
Update index even if fulltext-index is disabled
btut Aug 15, 2022
750346f
Adapt global search
btut Aug 15, 2022
00a7110
Improved keyword indexing
btut Aug 15, 2022
60c9ed3
Remove debug output
btut Aug 15, 2022
c71b749
Improve global search
btut Aug 15, 2022
9e7a41b
Checkstyle
btut Aug 15, 2022
6ead73b
Don't listen for query-update for group-filtering
btut Aug 15, 2022
5e4a780
Switch SearchGroups to Lucene
btut Aug 15, 2022
1c69125
Implement regex-string-wrapper
btut Aug 15, 2022
fe26dd1
Remove case-sensitive search preference
btut Aug 15, 2022
d759c24
Remove case-sensitive button from group dialog
btut Aug 15, 2022
35e9715
Update tooltip
btut Aug 15, 2022
e54b4e8
Move lucene-logic out of pdf package
btut Aug 15, 2022
af4d7f4
Add floating mode
btut Aug 16, 2022
9fdcfd7
Make sorting by score optional
btut Aug 16, 2022
f308f87
Only show two decimal places of the search score
btut Aug 16, 2022
25341a1
Remove unused icon from theme
btut Aug 16, 2022
87a00c7
Gray-out non-hits
btut Aug 16, 2022
518b997
Merge remote-tracking branch 'origin/main' into version6
koppor Aug 16, 2022
4da86d8
Better floating mode
btut Aug 17, 2022
9e8d549
Fix force-score-ordering bug
btut Aug 17, 2022
a4ccaf0
Remove SearchDisplayMode
btut Aug 17, 2022
1d4bef3
Always pre- and append wildcards for simple queries
btut Sep 3, 2022
44aae6e
Rename floating search to filtering search
btut Sep 3, 2022
79e1b9d
Index groups individually
btut Sep 3, 2022
61973a3
Localize score column header
btut Sep 3, 2022
356d942
Remove score from sort-order when disabling force sort by score
btut Sep 3, 2022
41d93fb
Fix search filter
btut Sep 3, 2022
c19b530
Make groupviewmode an enumset
btut Sep 3, 2022
79a753b
Checkstyle
btut Sep 3, 2022
c63a261
Floating groups
btut Sep 4, 2022
0ac4090
Invert-mode for groups
btut Sep 4, 2022
6405d4e
Merge branch 'main' into version6
btut Sep 4, 2022
dff397e
Merge branch 'version6' into luceneSearchBackend
btut Sep 4, 2022
00cefc2
Fix indexing
btut Sep 4, 2022
b0cf627
Merge branch 'main' into version6
btut Sep 4, 2022
6c65d63
Merge branch 'version6' into luceneSearchBackend
btut Sep 4, 2022
85445bd
Merge remote-tracking branch 'upstream/main' into luceneSearchBackend
Siedlerchr Sep 4, 2022
7c6b16d
Merge remote-tracking branch 'upstream/main' into version6
Siedlerchr Sep 4, 2022
1a5ded9
Merge branch 'luceneSearchBackend' of github.com:JabRef/jabref into l…
Siedlerchr Sep 4, 2022
3a4e665
Prepare CHANGELOG.md
Siedlerchr Sep 4, 2022
42d8726
Merge branch 'version6' of github.com:JabRef/jabref into version6
Siedlerchr Sep 4, 2022
7f15dce
Merge remote-tracking branch 'upstream/version6' into luceneSearchBac…
Siedlerchr Sep 4, 2022
e9efb46
Merge branch 'main' into version6
btut Sep 10, 2022
a711f02
Merge branch 'version6' into luceneSearchBackend
btut Sep 10, 2022
bc6710e
Checkstyle
btut Sep 10, 2022
3280d23
Temporary fix for linking to bibentries by hash
btut Sep 11, 2022
4412f6e
Improve DocumentReader
btut Sep 11, 2022
b7e39b3
Always make all fields searchable
btut Sep 11, 2022
5ade8ef
Make index-path output a debug message
btut Sep 11, 2022
dfd3c95
Fix deletition of old entries
btut Sep 11, 2022
4b17f10
Fix re-indexing on database loading
btut Sep 11, 2022
ce57fdb
Merge branch 'main' into version6
btut Sep 16, 2022
ec532e9
Merge branch 'version6' into luceneSearchBackend
btut Sep 16, 2022
7e098d6
Fixed empty databases in open database list
btut Sep 16, 2022
e455248
Make databasecontext in LibraryTab a property
btut Sep 17, 2022
79479fd
Merge branch 'main' into version6
btut Oct 15, 2022
ebe895a
Merge branch 'version6' into luceneSearchBackend
btut Oct 15, 2022
0adcad8
Cleanup (remove search rules)
btut Oct 16, 2022
3d042a8
Store search-results per context
btut Nov 5, 2022
c3eb8bf
Fixes and performance improvements
btut Nov 6, 2022
60de8b8
Update search when adding entries
btut Nov 6, 2022
0f32e91
Use pattern matching for cast
btut Nov 6, 2022
231f200
Fix pattern matching
btut Nov 7, 2022
202f514
Merge branch 'main' into version6
btut Nov 7, 2022
f602207
Merge branch 'version6' into luceneSearchBackend
btut Nov 7, 2022
675d75c
Fix merge
btut Nov 7, 2022
49eeb1d
Speed up switches between sorting/filtering modes
btut Nov 7, 2022
a25fa00
Merge remote-tracking branch 'upstream/main' into luceneSearchBackend
calixtus Dec 27, 2022
08aca25
Fixed merge errors
calixtus Dec 27, 2022
15b2152
Fixed small issues
calixtus Jan 1, 2023
f8b643b
Removed obsolete tests, fixed some tests
calixtus Jan 3, 2023
229fed7
Merge branch 'main' into luceneSearchBackend
koppor Jan 3, 2023
536ecfa
Fixed merge error in CHANGELOG.md
calixtus Jan 4, 2023
1117e17
Fixed checkstyle
calixtus Jan 4, 2023
ff4ad1c
Fixed more tests
calixtus Jan 4, 2023
7bdccf0
Removed obsolete tests
calixtus Jan 4, 2023
40de951
Fixes "Fixed merge error in CHANGELOG.md" by removing duplicate entries
koppor Jan 4, 2023
cbb5461
Merge remote-tracking branch 'upstream/luceneSearchBackend' into luce…
calixtus Jan 4, 2023
9e8863d
Merge branch 'main' into luceneSearchBackend
calixtus Jan 10, 2023
1f38a68
WiP on tests
calixtus Jan 23, 2023
5467095
Merge remote-tracking branch 'upstream/main' into luceneSearchBackend
calixtus Sep 12, 2023
00cecf8
Checkstyle
calixtus Sep 12, 2023
ad85c77
Checkstyle
calixtus Sep 12, 2023
3c1c08e
Merge remote-tracking branch 'upstream/main' into luceneSearchBackend
calixtus Sep 25, 2023
8981cdd
Merge remote-tracking branch 'upstream/main' into luceneSearchBackend
calixtus Sep 25, 2023
986bf3f
Merge remote-tracking branch 'upstream/luceneSearchBackend' into luce…
calixtus Sep 25, 2023
ed5cebf
Update Java version
calixtus Sep 25, 2023
afc4d67
Refine logging
koppor Sep 25, 2023
2f3203f
Fix compile error
koppor Sep 25, 2023
c771458
Add LuceneTest
koppor Sep 25, 2023
b795fa6
Update CHANGELOG.md
koppor Jan 11, 2024
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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// Install java.
// See https://github.com/devcontainers/features/tree/main/src/java#options for details.
"ghcr.io/devcontainers/features/java:1": {
"version": "20.0.2-tem",
"version": "21",
"installGradle": false,
"jdkDistro": "tem"
}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Added

- We reintroduced the floating search in the main table. [#8963](https://github.com/JabRef/jabref/pull/8963)
- We added the possibility to find (and add) papers that cite or are cited by a given paper. [#6187](https://github.com/JabRef/jabref/issues/6187)
- We added an error-specific message for when a download from a URL fails. [#9826](https://github.com/JabRef/jabref/issues/9826)
- We added support for customizing the citation command (e.g., `[@key1,@key2]`) when [pushing to external applications](https://docs.jabref.org/cite/pushtoapplications). [#10133](https://github.com/JabRef/jabref/issues/10133)
Expand All @@ -27,6 +28,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Fixed

- The search in the library now displays probable search hits instead of exact matches. Sorting by hit score can be done by the new score table column. [#8963](https://github.com/JabRef/jabref/pull/8963)
- It is possible again to use "current table sort order" for the order of entries when saving. [#9869](https://github.com/JabRef/jabref/issues/9869)
- Passwords can be stored in GNOME key ring. [#10274](https://github.com/JabRef/jabref/issues/10274)
- We fixed an issue where groups based on an aux file could not be created due to an exception [#10350](https://github.com/JabRef/jabref/issues/10350)
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ group = "org.jabref"
version = project.findProperty('projVersion') ?: '100.0.0'

java {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
// Workaround needed for Eclipse, probably because of https://github.com/gradle/gradle/issues/16922
// Should be removed as soon as Gradle 7.0.1 is released ( https://github.com/gradle/gradle/issues/16922#issuecomment-828217060 )
modularity.inferModulePath.set(false)

toolchain {
// If this is updated, also update .devcontainer/devcontainer.json#L34
languageVersion = JavaLanguageVersion.of(20)
languageVersion = JavaLanguageVersion.of(21)
}
}

Expand Down
16 changes: 5 additions & 11 deletions src/jmh/java/org/jabref/benchmarks/Benchmarks.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

import org.jabref.gui.Globals;
import org.jabref.logic.bibtex.FieldPreferences;
Expand All @@ -19,7 +17,6 @@
import org.jabref.logic.importer.fileformat.BibtexParser;
import org.jabref.logic.layout.format.HTMLChars;
import org.jabref.logic.layout.format.LatexToUnicodeFormatter;
import org.jabref.logic.search.SearchQuery;
import org.jabref.logic.util.OS;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseContext;
Expand All @@ -33,7 +30,6 @@
import org.jabref.model.groups.KeywordGroup;
import org.jabref.model.groups.WordKeywordGroup;
import org.jabref.model.metadata.MetaData;
import org.jabref.model.search.rules.SearchRules.SearchFlags;
import org.jabref.preferences.JabRefPreferences;

import org.openjdk.jmh.Main;
Expand Down Expand Up @@ -103,16 +99,14 @@ public String write() throws Exception {

@Benchmark
public List<BibEntry> search() {
// FIXME: Reuse SearchWorker here
SearchQuery searchQuery = new SearchQuery("Journal Title 500", EnumSet.noneOf(SearchFlags.class));
return database.getEntries().stream().filter(searchQuery::isMatch).collect(Collectors.toList());
// FixMe: Create Benchmark for LuceneSearch
return null;
}

@Benchmark
public List<BibEntry> parallelSearch() {
// FIXME: Reuse SearchWorker here
SearchQuery searchQuery = new SearchQuery("Journal Title 500", EnumSet.noneOf(SearchFlags.class));
return database.getEntries().parallelStream().filter(searchQuery::isMatch).collect(Collectors.toList());
public List<BibEntry> index() {
// FixMe: Create Benchmark for LuceneIndexer
return null;
}

@Benchmark
Expand Down
76 changes: 33 additions & 43 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
import org.jabref.logic.importer.util.FileFieldParser;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.pdf.FileAnnotationCache;
import org.jabref.logic.pdf.search.indexing.IndexingTaskManager;
import org.jabref.logic.pdf.search.indexing.PdfIndexer;
import org.jabref.logic.search.SearchQuery;
import org.jabref.logic.search.indexing.IndexingTaskManager;
import org.jabref.logic.search.indexing.LuceneIndexer;
import org.jabref.logic.shared.DatabaseLocation;
import org.jabref.logic.util.UpdateField;
import org.jabref.logic.util.io.FileUtil;
Expand Down Expand Up @@ -231,12 +231,11 @@ public void onDatabaseLoadingSucceed(ParserResult result) {

feedData(context);

if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) {
try {
indexingTaskManager.updateIndex(PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences()), bibDatabaseContext);
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
}
try {
indexingTaskManager.manageFulltextIndexAccordingToPrefs(LuceneIndexer.of(bibDatabaseContext, preferencesService));
indexingTaskManager.updateIndex(LuceneIndexer.of(bibDatabaseContext, preferencesService));
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
}
}

Expand Down Expand Up @@ -270,6 +269,9 @@ public void feedData(BibDatabaseContext bibDatabaseContextFromParserResult) {
bibDatabaseContextFromParserResult.getDatabase().registerListener(this);
bibDatabaseContextFromParserResult.getMetaData().registerListener(this);

if (this.tableModel != null) {
this.tableModel.removeBindings();
}
this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, stateManager);
citationStyleCache = new CitationStyleCache(bibDatabaseContextFromParserResult);
annotationCache = new FileAnnotationCache(bibDatabaseContextFromParserResult, preferencesService.getFilePreferences());
Expand Down Expand Up @@ -389,9 +391,7 @@ public void updateTabTitle(boolean isChanged) {
setTooltip(new Tooltip(toolTipText.toString()));
});

if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) {
indexingTaskManager.updateDatabaseName(tabTitle.toString());
}
indexingTaskManager.updateDatabaseName(tabTitle.toString());
}

@Subscribe
Expand Down Expand Up @@ -904,7 +904,7 @@ public void listen(EntriesAddedEvent addedEntriesEvent) {

// Automatically add new entries to the selected group (or set of groups)
if (preferencesService.getGroupsPreferences().shouldAutoAssignGroup()) {
stateManager.getSelectedGroup(bibDatabaseContext).forEach(
stateManager.getSelectedGroups(bibDatabaseContext).forEach(
selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries()));
}
}
Expand Down Expand Up @@ -944,50 +944,40 @@ private class IndexUpdateListener {

@Subscribe
public void listen(EntriesAddedEvent addedEntryEvent) {
if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) {
try {
PdfIndexer pdfIndexer = PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences());
for (BibEntry addedEntry : addedEntryEvent.getBibEntries()) {
indexingTaskManager.addToIndex(pdfIndexer, addedEntry, bibDatabaseContext);
}
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
try {
LuceneIndexer luceneIndexer = LuceneIndexer.of(bibDatabaseContext, preferencesService);
for (BibEntry addedEntry : addedEntryEvent.getBibEntries()) {
indexingTaskManager.addToIndex(luceneIndexer, addedEntry);
}
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
}
}

@Subscribe
public void listen(EntriesRemovedEvent removedEntriesEvent) {
if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) {
try {
PdfIndexer pdfIndexer = PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences());
for (BibEntry removedEntry : removedEntriesEvent.getBibEntries()) {
indexingTaskManager.removeFromIndex(pdfIndexer, removedEntry);
}
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
try {
LuceneIndexer luceneIndexer = LuceneIndexer.of(bibDatabaseContext, preferencesService);
for (BibEntry removedEntry : removedEntriesEvent.getBibEntries()) {
indexingTaskManager.removeFromIndex(luceneIndexer, removedEntry);
}
} catch (IOException e) {
LOGGER.error("Cannot access lucene index", e);
}
}

@Subscribe
public void listen(FieldChangedEvent fieldChangedEvent) {
if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) {
if (fieldChangedEvent.getField().equals(StandardField.FILE)) {
List<LinkedFile> oldFileList = FileFieldParser.parse(fieldChangedEvent.getOldValue());
List<LinkedFile> newFileList = FileFieldParser.parse(fieldChangedEvent.getNewValue());

List<LinkedFile> addedFiles = new ArrayList<>(newFileList);
addedFiles.remove(oldFileList);
List<LinkedFile> removedFiles = new ArrayList<>(oldFileList);
removedFiles.remove(newFileList);

try {
indexingTaskManager.addToIndex(PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences()), fieldChangedEvent.getBibEntry(), addedFiles, bibDatabaseContext);
indexingTaskManager.removeFromIndex(PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences()), fieldChangedEvent.getBibEntry(), removedFiles);
} catch (IOException e) {
LOGGER.warn("I/O error when writing lucene index", e);
for (BibEntry bibEntry : fieldChangedEvent.getBibEntries()) {
try {
List<LinkedFile> toRemoveList = new ArrayList<>();
if (fieldChangedEvent.getField().equals(StandardField.FILE)) {
toRemoveList.addAll(FileFieldParser.parse(fieldChangedEvent.getOldValue()));
toRemoveList.removeAll(FileFieldParser.parse(fieldChangedEvent.getNewValue()));
}
indexingTaskManager.updateIndex(LuceneIndexer.of(bibDatabaseContext, preferencesService), bibEntry, toRemoveList);
} catch (IOException e) {
LOGGER.warn("I/O error when writing lucene index", e);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void createMenu() {

new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.REBUILD_FULLTEXT_SEARCH_INDEX, new RebuildFulltextSearchIndexAction(stateManager, frame::getCurrentLibraryTab, dialogService, preferencesService.getFilePreferences(), taskExecutor))
factory.createMenuItem(StandardActions.REBUILD_FULLTEXT_SEARCH_INDEX, new RebuildFulltextSearchIndexAction(stateManager, frame::getCurrentLibraryTab, dialogService, preferencesService, preferencesService.getFilePreferences(), taskExecutor))
);
SidePaneType webSearchPane = SidePaneType.WEB_SEARCH;
SidePaneType groupsPane = SidePaneType.GROUPS;
Expand Down
20 changes: 8 additions & 12 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyListProperty;
import javafx.beans.property.ReadOnlyListWrapper;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
Expand All @@ -31,6 +30,7 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.groups.GroupTreeNode;
import org.jabref.model.pdf.search.LuceneSearchResults;
import org.jabref.model.util.OptionalUtil;

import com.tobiasdiez.easybind.EasyBind;
Expand Down Expand Up @@ -60,7 +60,7 @@ public class StateManager {
private final ObservableList<BibEntry> selectedEntries = FXCollections.observableArrayList();
private final ObservableMap<BibDatabaseContext, ObservableList<GroupTreeNode>> selectedGroups = FXCollections.observableHashMap();
private final OptionalObjectProperty<SearchQuery> activeSearchQuery = OptionalObjectProperty.empty();
private final ObservableMap<BibDatabaseContext, IntegerProperty> searchResultMap = FXCollections.observableHashMap();
private final ObservableMap<BibDatabaseContext, Map<BibEntry, LuceneSearchResults>> searchResults = FXCollections.observableHashMap();
private final OptionalObjectProperty<Node> focusOwner = OptionalObjectProperty.empty();
private final ObservableList<Pair<BackgroundTask<?>, Task<?>>> backgroundTasks = FXCollections.observableArrayList(task -> new Observable[]{task.getValue().progressProperty(), task.getValue().runningProperty()});
private final EasyBinding<Boolean> anyTaskRunning = EasyBind.reduce(backgroundTasks, tasks -> tasks.map(Pair::getValue).anyMatch(Task::isRunning));
Expand Down Expand Up @@ -97,14 +97,6 @@ public OptionalObjectProperty<SearchQuery> activeSearchQueryProperty() {
return activeSearchQuery;
}

public void setActiveSearchResultSize(BibDatabaseContext database, IntegerProperty resultSize) {
searchResultMap.put(database, resultSize);
}

public IntegerProperty getSearchResultSize() {
return searchResultMap.getOrDefault(activeDatabase.getValue().orElse(new BibDatabaseContext()), new SimpleIntegerProperty(0));
}

public ReadOnlyListProperty<GroupTreeNode> activeGroupProperty() {
return activeGroups.getReadOnlyProperty();
}
Expand All @@ -122,7 +114,7 @@ public void setSelectedGroups(BibDatabaseContext database, List<GroupTreeNode> n
selectedGroups.put(database, FXCollections.observableArrayList(newSelectedGroups));
}

public ObservableList<GroupTreeNode> getSelectedGroup(BibDatabaseContext database) {
public ObservableList<GroupTreeNode> getSelectedGroups(BibDatabaseContext database) {
ObservableList<GroupTreeNode> selectedGroupsForDatabase = selectedGroups.get(database);
return selectedGroupsForDatabase != null ? selectedGroupsForDatabase : FXCollections.observableArrayList();
}
Expand Down Expand Up @@ -205,6 +197,10 @@ public void setLastAutomaticFieldEditorEdit(LastAutomaticFieldEditorEdit automat
lastAutomaticFieldEditorEditProperty().set(automaticFieldEditorEdit);
}

public ObservableMap<BibDatabaseContext, Map<BibEntry, LuceneSearchResults>> getSearchResults() {
return searchResults;
}

public List<String> collectAllDatabasePaths() {
List<String> list = new ArrayList<>();
getOpenDatabases().stream()
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/jabref/gui/entryeditor/CommentsTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.pdf.search.indexing.IndexingTaskManager;
import org.jabref.logic.search.indexing.IndexingTaskManager;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.Field;
Expand All @@ -35,9 +35,9 @@ public CommentsTab(PreferencesService preferences,
DialogService dialogService,
StateManager stateManager,
ThemeManager themeManager,
IndexingTaskManager indexingTaskManager,
TaskExecutor taskExecutor,
JournalAbbreviationRepository journalAbbreviationRepository) {
JournalAbbreviationRepository journalAbbreviationRepository,
IndexingTaskManager indexingTaskManager) {
super(
false,
databaseContext,
Expand All @@ -49,8 +49,7 @@ public CommentsTab(PreferencesService preferences,
themeManager,
taskExecutor,
journalAbbreviationRepository,
indexingTaskManager
);
indexingTaskManager);
this.defaultOwner = preferences.getOwnerPreferences().getDefaultOwner();
setText(Localization.lang("Comments"));
setGraphic(IconTheme.JabRefIcons.COMMENT.getGraphicNode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.pdf.search.indexing.IndexingTaskManager;
import org.jabref.logic.search.indexing.IndexingTaskManager;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
Expand Down
Loading