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

Searching with Postgres #11803

Merged
merged 129 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
f77956e
Convert to record
LoayGhreeb Sep 20, 2024
0219ddf
Add embedded-postgres dependency
LoayGhreeb Sep 20, 2024
7602020
Merge branch 'main' into postgresql
LoayGhreeb Sep 21, 2024
351d01c
Setup embedded postgre server
LoayGhreeb Sep 22, 2024
9efee36
Indexing entries with Postgres
LoayGhreeb Sep 22, 2024
24e222a
Remove Lucene bib fields indexer
LoayGhreeb Sep 22, 2024
bc93bf1
Use PreparedStatement to fix escaping characters
LoayGhreeb Sep 22, 2024
fb64865
Rename LuceneManager to IndexManager
LoayGhreeb Sep 22, 2024
7839c68
Begin to implement "new" search syntax
koppor Sep 22, 2024
65fd4fe
Some new operators
koppor Sep 22, 2024
108947f
Change log level of EmbeddedPostgres
LoayGhreeb Sep 23, 2024
1e3482d
Handle search flags
LoayGhreeb Sep 23, 2024
d164248
Fix default field
LoayGhreeb Sep 23, 2024
593105c
Fix handling of anyfield (and add "any" as alias)
koppor Sep 23, 2024
2749b86
Openrewrite...
koppor Sep 23, 2024
58d7e25
More test cases
LoayGhreeb Sep 23, 2024
9028748
Remove non-covered libraries
koppor Sep 23, 2024
1787b5b
Merge branch 'postgresql' of github.com:JabRef/jabref into postgresql
koppor Sep 23, 2024
64bc03c
Use LIKE syntax as default instead of regex
LoayGhreeb Sep 23, 2024
519e390
Merge branch 'main' into postgresql
LoayGhreeb Sep 24, 2024
f61314c
Update module-info.java
LoayGhreeb Sep 24, 2024
250a1b0
Create "query" package
LoayGhreeb Sep 24, 2024
5314e66
Postgres searcher
LoayGhreeb Sep 24, 2024
fd2ace1
Return back the exact match operator
LoayGhreeb Sep 24, 2024
59ef889
Merge branch 'main' into postgresql
LoayGhreeb Sep 24, 2024
aa55eb9
checkstyle
LoayGhreeb Sep 24, 2024
239fde0
Add link
koppor Sep 24, 2024
fc6ad3c
Merge remote-tracking branch 'origin/main' into postgresql
koppor Sep 24, 2024
08b1dfb
WIP
koppor Sep 24, 2024
ab87dd5
Fix compilation
LoayGhreeb Sep 24, 2024
70d7eda
Merge branch 'main' into postgresql
LoayGhreeb Sep 26, 2024
e4eaef3
WIP
LoayGhreeb Sep 26, 2024
98bfffa
Intermediate result
koppor Sep 26, 2024
c5fcdaf
Query should be OK
koppor Sep 26, 2024
b473b6c
Indexing of split values
koppor Sep 26, 2024
ad8824d
Fix tests compile
LoayGhreeb Sep 26, 2024
97dc941
Use first name Last name for authors
LoayGhreeb Sep 26, 2024
ff79dd3
Refactor SQL query visitor
LoayGhreeb Sep 26, 2024
baa73cb
Adapt tests
LoayGhreeb Sep 26, 2024
9d0cf45
Merge branch 'main' into postgresql
LoayGhreeb Sep 27, 2024
066c743
Use join with EXACT_MATCH only
LoayGhreeb Sep 27, 2024
d9f93c4
Update to Postgres 17
LoayGhreeb Sep 28, 2024
38c0265
Attempt to use sub-queries with CTEs
LoayGhreeb Sep 28, 2024
e8a2836
Fix CTEs sub-queries and grouping
LoayGhreeb Sep 28, 2024
9073d0c
group matches by entry_id
LoayGhreeb Sep 28, 2024
51f1655
Merge branch 'main' into postgresql
LoayGhreeb Sep 29, 2024
3cbac93
Merge branch 'main' into postgresql
LoayGhreeb Sep 30, 2024
a34f8bd
Use NOT IN for negation queries
LoayGhreeb Sep 30, 2024
1fe2b06
Fix unary NOT operator
LoayGhreeb Sep 30, 2024
c6869cc
Use split values table for EXACT_MATCH queries
LoayGhreeb Sep 30, 2024
72b26e0
Prepare for linked files index (full-text)
LoayGhreeb Oct 2, 2024
a0cc539
Prepare linked files tables
LoayGhreeb Oct 2, 2024
27a0143
Fix searching
LoayGhreeb Oct 2, 2024
1c951fb
Use multi column index
LoayGhreeb Oct 2, 2024
981f158
fix merged module issues
Siedlerchr Oct 2, 2024
29c179e
Fix update event
LoayGhreeb Oct 4, 2024
e3d0628
Remove postgres linked files indexer
LoayGhreeb Oct 4, 2024
fb6f013
Remove and insert field on update event
LoayGhreeb Oct 4, 2024
65d7681
Remove search score column
LoayGhreeb Oct 4, 2024
f54bf6e
Update search groups matches
LoayGhreeb Oct 4, 2024
4b90aa5
Merge branch 'main' into postgresql
LoayGhreeb Oct 4, 2024
6ab8f55
Remove search_score from tale preferences
LoayGhreeb Oct 4, 2024
4fc088f
Migrate search groups flags to new syntax
LoayGhreeb Oct 4, 2024
1b1f0ff
Localization
LoayGhreeb Oct 4, 2024
855cf3c
Fix dialog message
LoayGhreeb Oct 4, 2024
c1dd99a
Merge branch 'main' into postgresql
LoayGhreeb Oct 4, 2024
9a35891
Ignores groups field from default searches
LoayGhreeb Oct 4, 2024
1ccfdb4
Use TYPE_HEADER field for entrytype
LoayGhreeb Oct 4, 2024
8450f89
Search to Lucene query for linked files searching
LoayGhreeb Oct 5, 2024
0b14663
Merge branch 'main' into postgresql
LoayGhreeb Oct 5, 2024
c127aaf
Marge linked files and bib fields results
LoayGhreeb Oct 5, 2024
b2c5428
Searching in background task
LoayGhreeb Oct 5, 2024
a3b8328
Fix search to SQL tests
LoayGhreeb Oct 6, 2024
0468812
Merge branch 'main' into postgresql
LoayGhreeb Oct 6, 2024
b7f6bf3
Localization test
LoayGhreeb Oct 6, 2024
2c50df8
Fix DatabaseSearcherTest
LoayGhreeb Oct 6, 2024
77bf811
Fix DatabaseSearcherWithBibFilesTest
LoayGhreeb Oct 6, 2024
b9975fc
Fix exportMatches test
LoayGhreeb Oct 6, 2024
9f02d04
Update src/main/java/org/jabref/model/entry/BibEntry.java
LoayGhreeb Oct 6, 2024
2751844
Add SINGLE_ENTRY_LINK to latex field
LoayGhreeb Oct 6, 2024
c5bde17
Remove changelog entries
LoayGhreeb Oct 6, 2024
b291b6c
Remove groups migration from localization
LoayGhreeb Oct 6, 2024
9e87053
Merge branch 'main' into postgresql
LoayGhreeb Oct 7, 2024
3bd961f
Merge branch 'main' into postgresql
LoayGhreeb Oct 9, 2024
c0a2593
Extract search terms from query (ignore negated terms)
LoayGhreeb Oct 9, 2024
bf5de09
Fix architecture test
LoayGhreeb Oct 9, 2024
46bb0d3
Highlight Preview viewer with Postgres regexp_replace
LoayGhreeb Oct 9, 2024
d451c2b
OpenRewrite
LoayGhreeb Oct 9, 2024
887d5e3
Remove onRunning
LoayGhreeb Oct 9, 2024
d26c8b9
Set search query listener in the constructor
LoayGhreeb Oct 9, 2024
eafdf30
Fix preview tab scrolling
LoayGhreeb Oct 9, 2024
d174508
Use prepared statement to fix escaping
LoayGhreeb Oct 9, 2024
ef959bc
Use prepared statement for sql query
LoayGhreeb Oct 10, 2024
e981bdc
Merge branch 'main' into postgresql
LoayGhreeb Oct 11, 2024
74f98ef
Store the start and end positions for every field
LoayGhreeb Oct 11, 2024
a7ca4d3
WIP highlight source tab
LoayGhreeb Oct 11, 2024
d4c0123
Merge branch 'main' into postgresql
LoayGhreeb Oct 11, 2024
5edd1a5
Fix source tab highlighting
LoayGhreeb Oct 11, 2024
ef27dc5
Return regex, case-sensitive flags back to the search bar
LoayGhreeb Oct 12, 2024
df2e12b
Use for search bar flags for unfielded terms
LoayGhreeb Oct 12, 2024
fb0fbb8
Skip migrations for unfieleded terms
LoayGhreeb Oct 12, 2024
fac963f
Return regex, case-sensitive CheckBox to search groups dialog
LoayGhreeb Oct 12, 2024
ef997e2
Merge branch 'main' into postgresql
LoayGhreeb Oct 12, 2024
6c4f1fa
Apply suggestions from code review
LoayGhreeb Oct 13, 2024
3b46b6d
Merge branch 'main' into postgresql
LoayGhreeb Oct 13, 2024
c7baf04
Update JabRef_en.properties
LoayGhreeb Oct 13, 2024
c32a866
Merge remote-tracking branch 'origin/main' into postgresql
koppor Oct 16, 2024
196c7ff
Merge branch 'main' into postgresql
LoayGhreeb Oct 19, 2024
a420070
Merge branch 'main' into postgresql
LoayGhreeb Oct 21, 2024
eb570fb
Fix search grammar to support special chars
LoayGhreeb Oct 21, 2024
eb23f05
Create SearchQueryTest.java
LoayGhreeb Oct 22, 2024
ae0154c
Adapt SQL visitor with new grammar
LoayGhreeb Oct 22, 2024
6cc6ebd
Allow to use quotes without escaping
LoayGhreeb Oct 22, 2024
50a919d
Merge branch 'main' into postgresql
LoayGhreeb Oct 22, 2024
b4bbe54
escape SQL wildcard chars
LoayGhreeb Oct 22, 2024
7c901f9
Reorder methods
LoayGhreeb Oct 22, 2024
58e0163
Adapt SearchFlagsToExpressionVisitor
LoayGhreeb Oct 22, 2024
070dcc6
Adapt SearchToLuceneVisitor
LoayGhreeb Oct 22, 2024
f4c694a
Adapt SearchQueryExtractorVisitor
LoayGhreeb Oct 22, 2024
e7008fd
Fix tests
LoayGhreeb Oct 22, 2024
19ca644
Fix DatabaseSearcherTest
LoayGhreeb Oct 22, 2024
e225cdc
Fix search terms patten for highlighting
LoayGhreeb Oct 22, 2024
77ddece
Highlight source tab field by field according to the search query
LoayGhreeb Oct 22, 2024
0b9eaf5
Apply suggestions from code review
LoayGhreeb Oct 22, 2024
b3d0053
Merge branch 'main' into postgresql
LoayGhreeb Oct 22, 2024
750a320
Update src/main/java/org/jabref/gui/importer/actions/SearchGroupsMigr…
LoayGhreeb Oct 23, 2024
dde1a26
Merge branch 'main' into postgresql
LoayGhreeb Oct 23, 2024
ddd5392
Set default operator to AND
LoayGhreeb Oct 23, 2024
3cfeb5d
remove debug
LoayGhreeb Oct 23, 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
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
### Added

- We added a "view as BibTeX" option before importing an entry from the citation relation tab. [#11826](https://github.com/JabRef/jabref/issues/11826)
- We added probable search hits instead of exact matches. Sorting by hit score can be done by the new score table column. [#11542](https://github.com/JabRef/jabref/pull/11542)
- We added support finding LaTeX-encoded special characters based on plain Unicode and vice versa. [#11542](https://github.com/JabRef/jabref/pull/11542)
- When a search hits a file, the file icon of that entry is changed accordingly. [#11542](https://github.com/JabRef/jabref/pull/11542)
- We added an AI-based chat for entries with linked PDF files. [#11430](https://github.com/JabRef/jabref/pull/11430)
Expand Down Expand Up @@ -42,8 +41,6 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Changed

- The search syntax is changed to [Apache Lucene syntax](https://lucene.apache.org/core/9_11_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Overview) (also to be similar to the [online search syntax](https://docs.jabref.org/collect/import-using-online-bibliographic-database#search-syntax)). [#11542](https://github.com/JabRef/jabref/pull/11542/)
- When searching using a regular expression, one needs to enclose the search string in `/`. [#11542](https://github.com/JabRef/jabref/pull/11542/)
- A search in "any" fields ignores the [groups](https://docs.jabref.org/finding-sorting-and-cleaning-entries/groups). [#7996](https://github.com/JabRef/jabref/issues/7996)
- When a communication error with an [online service](https://docs.jabref.org/collect/import-using-online-bibliographic-database) occurs, JabRef displays the HTTP error. [#11223](https://github.com/JabRef/jabref/issues/11223)
- The Pubmed/Medline Plain importer now imports the PMID field as well [#11488](https://github.com/JabRef/jabref/issues/11488)
Expand Down Expand Up @@ -103,7 +100,6 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Removed

- We removed support for case-sensitive and exact search. [#11542](https://github.com/JabRef/jabref/pull/11542)
- We removed the description of search strings. [#11542](https://github.com/JabRef/jabref/pull/11542)
- We removed support for importing using the SilverPlatterImporter (`Record INSPEC`). [#11576](https://github.com/JabRef/jabref/pull/11576)
- We removed support for automatically generating file links using the CLI (`--automaticallySetFileLinks`).
Expand Down
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ dependencies {
// Even if "compileOnly" is used, IntelliJ always adds to module-info.java. To avoid issues during committing, we use "implementation" instead of "compileOnly"
implementation 'io.github.adr:e-adr:2.0.0-SNAPSHOT'

implementation 'io.zonky.test:embedded-postgres:2.0.7'
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0')

testImplementation 'io.github.classgraph:classgraph:4.8.177'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0'
testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3'
Expand Down Expand Up @@ -793,9 +796,13 @@ jlink {
requires 'org.apache.commons.lang3'
requires 'org.apache.commons.logging'
requires 'org.apache.commons.text'
requires 'org.apache.commons.codec'
requires 'org.apache.commons.io'
requires 'org.apache.commons.compress'
requires 'org.freedesktop.dbus'
requires 'org.jsoup'
requires 'org.slf4j'
requires 'org.tukaani.xz';
uses 'ai.djl.engine.EngineProvider'
uses 'ai.djl.repository.RepositoryFactory'
uses 'ai.djl.repository.zoo.ZooProvider'
Expand All @@ -807,6 +814,7 @@ jlink {
uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin'
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
uses 'org.mariadb.jdbc.tls.TlsSocketPlugin'
uses 'org.postgresql.shaded.com.ongres.stringprep.Profile'

provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin'
provides 'java.sql.Driver' with 'org.postgresql.Driver'
Expand Down
18 changes: 14 additions & 4 deletions external-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ License: MIT
```

```yaml
Id:io.github.adr:e-adr
Project:EmbeddedArchitecturalDecisionRecords
URL:https://github.com/adr/e-adr/
License:EPL-2.0
Id: io.github.adr:e-adr
Project: EmbeddedArchitecturalDecisionRecords
URL: https://github.com/adr/e-adr/
License: EPL-2.0
```

```yaml
Expand All @@ -363,6 +363,13 @@ URL: https://github.com/java-diff-utils/java-diff-utils
License: Apache-2.0
```

```yaml
Id: io.zonky.test:embedded-postgres
Project: embedded-postgres
URL: https://github.com/zonkyio/embedded-postgres
License: Apache-2.0
```

```yaml
Id: jakarta.annotation:jakarata.annotation-api
Project: Jakarta Annotations
Expand Down Expand Up @@ -798,6 +805,7 @@ de.undercouch:citeproc-java:3.1.0
eu.lestard:doc-annotations:0.2
info.debatty:java-string-similarity:2.0.0
io.github.java-diff-utils:java-diff-utils:4.12
io.zonky.test:embedded-postgres:2.0.7
jakarta.activation:jakarta.activation-api:2.1.3
jakarta.annotation:jakarta.annotation-api:2.1.1
jakarta.inject:jakarta.inject-api:2.0.1
Expand All @@ -813,6 +821,7 @@ net.jodah:typetools:0.6.1
net.synedra:validatorfx:0.5.0
one.jpro.jproutils:tree-showing:0.2.2
org.antlr:antlr4-runtime:4.13.2
org.apache.commons:commons-compress:1.27.1
org.apache.commons:commons-csv:1.11.0
org.apache.commons:commons-lang3:3.17.0
org.apache.commons:commons-text:1.12.0
Expand Down Expand Up @@ -889,6 +898,7 @@ org.slf4j:slf4j-api:2.0.16
org.tinylog:slf4j-tinylog:2.7.0
org.tinylog:tinylog-api:2.7.0
org.tinylog:tinylog-impl:2.7.0
org.tukaani:xz:1.9
org.yaml:snakeyaml:2.3
pt.davidafsilva.apple:jkeychain:1.1.0
tech.units:indriya:2.2
Expand Down
97 changes: 65 additions & 32 deletions src/main/antlr4/org/jabref/search/Search.g4
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,82 @@
* These search expressions are used for searching the bibtex library. They are heavily used for search groups.
*/
grammar Search;
options { caseInsensitive = true; }

WS: [ \t] -> skip; // whitespace is ignored/skipped
WS: [ \t\n\r]+ -> skip; // whitespace is ignored/skipped

LPAREN:'(';
RPAREN:')';
LPAREN: '(';
RPAREN: ')';

EQUAL:'='; // semantically the same as CONTAINS
EEQUAL:'=='; // semantically the same as MATCHES
NEQUAL:'!=';
EQUAL: '='; // case insensitive contains, semantically the same as CONTAINS
CEQUAL: '=!'; // case sensitive contains

AND:[aA][nN][dD]; // 'and' case insensitive
OR:[oO][rR]; // 'or' case insensitive
CONTAINS:[cC][oO][nN][tT][aA][iI][nN][sS]; // 'contains' case insensitive
MATCHES:[mM][aA][tT][cC][hH][eE][sS]; // 'matches' case insensitive
NOT:[nN][oO][tT]; // 'not' case insensitive
EEQUAL: '=='; // exact match case insensitive, semantically the same as MATCHES
CEEQUAL: '==!'; // exact match case sensitive

STRING:QUOTE (~'"')* QUOTE;
QUOTE:'"';
REQUAL: '=~'; // regex check case insensitive
CREEQUAL: '=~!'; // regex check case sensitive

FIELDTYPE:LETTER+;
// fragments are not accessible from the code, they are only for describing the grammar better
fragment LETTER : ~[ \t"()=!];
NEQUAL: '!='; // negated case insensitive contains
NCEQUAL: '!=!'; // negated case sensitive contains

NEEQUAL: '!=='; // negated case insensitive exact match
NCEEQUAL: '!==!'; // negated case sensitive exact match

start:
expression EOF;
NREQUAL: '!=~'; // negated regex check case insensitive
NCREEQUAL: '!=~!'; // negated regex check case sensitive

// labels are used to refer to parts of the rules in the generated code later on
// label=actualThingy
expression:
LPAREN expression RPAREN #parenExpression // example: (author=miller)
| NOT expression #unaryExpression // example: not author = miller
| left=expression operator=AND right=expression #binaryExpression // example: author = miller and title = test
| left=expression operator=OR right=expression #binaryExpression // example: author = miller or title = test
| comparison #atomExpression
AND: 'AND';
OR: 'OR';
CONTAINS: 'CONTAINS';
MATCHES: 'MATCHES';
NOT: 'NOT';

FIELD: [A-Z]+;
STRING_LITERAL: '"' ('\\"' | ~["])* '"'; // " should be escaped with a backslash
TERM: ('\\' [=!~()] | ~[ \t\n\r=!~()])+; // =!~() should be escaped with a backslash

start
: EOF
| andExpression EOF
;

andExpression
: expression+ #implicitAndExpression // example: author = miller year = 2010 --> equivalent to: author = miller AND year = 2010
;

expression
: LPAREN andExpression RPAREN #parenExpression // example: (author = miller)
| NOT expression #negatedExpression // example: NOT author = miller
| left = expression bin_op = AND right = expression #binaryExpression // example: author = miller AND year = 2010
| left = expression bin_op = OR right = expression #binaryExpression // example: author = miller OR year = 2010
| comparison #comparisonExpression // example: miller OR author = miller
;

comparison
: FIELD operator searchValue // example: author = miller
| searchValue // example: miller
;

comparison:
left=name operator=(CONTAINS | MATCHES | EQUAL | EEQUAL | NEQUAL) right=name // example: author != miller
| right=name // example: miller (search all fields)
operator
: EQUAL
| CEQUAL
| EEQUAL
| CEEQUAL
| REQUAL
| CREEQUAL
| NEQUAL
| NCEQUAL
| NEEQUAL
| NCEEQUAL
| NREQUAL
| NCREEQUAL
| CONTAINS
| MATCHES
;

name:
STRING // example: "miller"
| FIELDTYPE // example: author
searchValue
: STRING_LITERAL
| FIELD
| TERM
;
7 changes: 5 additions & 2 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
// endregion

// region: SQL databases
requires embedded.postgres;
requires org.tukaani.xz;
requires ojdbc10;
requires org.postgresql.jdbc;
requires org.mariadb.jdbc;
Expand All @@ -108,6 +110,7 @@
requires io.github.javadiffutils;
requires java.string.similarity;
requires org.apache.commons.cli;
requires org.apache.commons.compress;
requires org.apache.commons.csv;
requires org.apache.commons.io;
requires org.apache.commons.lang3;
Expand Down Expand Up @@ -160,8 +163,8 @@
// endregion

// region: Lucene
/**
* In case the version is updated, please also increment {@link org.jabref.model.search.SearchFieldConstants#VERSION} to trigger reindexing.
/*
* In case the version is updated, please also increment {@link org.jabref.model.search.LinkedFilesConstants.VERSION} to trigger reindexing.
*/
uses org.apache.lucene.codecs.lucene100.Lucene100Codec;
requires org.apache.lucene.analysis.common;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jabref.gui.util.DefaultFileUpdateMonitor;
import org.jabref.logic.UiCommand;
import org.jabref.logic.preferences.CliPreferences;
import org.jabref.logic.search.PostgreServer;
import org.jabref.logic.util.HeadlessExecutorService;
import org.jabref.migrations.PreferencesMigrations;

Expand Down Expand Up @@ -38,6 +39,9 @@ public static void main(String[] args) {

PreferencesMigrations.runMigrations(preferences);

PostgreServer postgreServer = new PostgreServer();
Injector.setModelOrService(PostgreServer.class, postgreServer);

JabRefGUI.setup(uiCommands, preferences, fileUpdateMonitor);
JabRefGUI.launch(JabRefGUI.class, args);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
import org.jabref.model.search.SearchQuery;
import org.jabref.model.search.query.SearchQuery;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.DummyFileUpdateMonitor;
import org.jabref.model.util.FileUpdateMonitor;
Expand Down Expand Up @@ -458,8 +458,8 @@ private boolean exportMatches(List<ParserResult> loaded) {

List<BibEntry> matches;
try {
// extract current thread task executor from luceneManager
matches = new DatabaseSearcher(query, databaseContext, new CurrentThreadTaskExecutor(), cliPreferences.getFilePreferences()).getMatches();
// extract current thread task executor from indexManager
matches = new DatabaseSearcher(query, databaseContext, new CurrentThreadTaskExecutor(), cliPreferences).getMatches();
} catch (IOException e) {
LOGGER.error("Error occurred when searching", e);
return false;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.jabref.logic.net.ProxyRegisterer;
import org.jabref.logic.remote.RemotePreferences;
import org.jabref.logic.remote.server.RemoteListenerServerManager;
import org.jabref.logic.search.PostgreServer;
import org.jabref.logic.util.BuildInfo;
import org.jabref.logic.util.FallbackExceptionHandler;
import org.jabref.logic.util.HeadlessExecutorService;
Expand Down Expand Up @@ -395,6 +396,9 @@ public static void shutdownThreadPools() {
LOGGER.trace("Shutting down directoryMonitor");
DirectoryMonitor directoryMonitor = Injector.instantiateModelOrService(DirectoryMonitor.class);
directoryMonitor.shutdown();
LOGGER.trace("Shutting down postgreServer");
PostgreServer postgreServer = Injector.instantiateModelOrService(PostgreServer.class);
postgreServer.shutdown();
LOGGER.trace("Shutting down HeadlessExecutorService");
HeadlessExecutorService.INSTANCE.shutdownEverything();
LOGGER.trace("Finished shutdownThreadPools");
Expand Down
Loading
Loading