Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.search.inmemory

public Class InMemoryLuceneSearchBackend

extends Object
implements SearchBackend
Class Inheritance
All Implemented Interfaces
org.jabref.logic.search.SearchBackend
Annotations
@NullMarked
Imports
java.util.EnumSet, .List, org.jabref.logic.FilePreferences, org.jabref.logic.search.LinkedFilesIndexManager, .SearchBackend, org.jabref.logic.util.TaskExecutor, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .BibEntryPreferences, org.jabref.model.entry.event.FieldChangedEvent, org.jabref.model.search.SearchFlags, org.jabref.model.search.query.SearchQuery, .SearchResults, org.jspecify.annotations.NullMarked

A search backend that evaluates metadata in memory and searches linked files with Lucene.

Field Summary

Modifier and TypeField and Description
private final InMemorySearchBackend
private final LinkedFilesIndexManager

Constructor Summary

AccessConstructor and Description
public
InMemoryLuceneSearchBackend(BibDatabaseContext databaseContext, BibEntryPreferences bibEntryPreferences, FilePreferences filePreferences, TaskExecutor taskExecutor)

Method Summary

Modifier and TypeMethod and Description
public void
public void
close()

Implements org.jabref.logic.search.SearchBackend.close.

Release backend resources (DB connections, Lucene index handles, …).

private static SearchQuery
public boolean
isEntryMatched(BibEntry entry, SearchQuery query)

Implements org.jabref.logic.search.SearchBackend.isEntryMatched.

Test a single entry against the query without re-running a full library search.

public void
rebuildFullTextIndex()

Implements org.jabref.logic.search.SearchBackend.rebuildFullTextIndex.

Re-index linked-file fulltext from scratch.

public void
public SearchResults
search(SearchQuery query)

Implements org.jabref.logic.search.SearchBackend.search.

Run the query against this backend.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inMemorySearchBackendback to summary
private final InMemorySearchBackend inMemorySearchBackend
linkedFilesIndexManagerback to summary
private final LinkedFilesIndexManager linkedFilesIndexManager

Constructor Detail

InMemoryLuceneSearchBackendback to summary
public InMemoryLuceneSearchBackend(BibDatabaseContext databaseContext, BibEntryPreferences bibEntryPreferences, FilePreferences filePreferences, TaskExecutor taskExecutor)

Method Detail

addToIndexback to summary
public void addToIndex(List<BibEntry> entries)

Implements org.jabref.logic.search.SearchBackend.addToIndex.

Doc from org.jabref.logic.search.SearchBackend.addToIndex.

Indexing lifecycle. Backends without an index (e.g. in-memory) implement these as no-ops.

Annotations
@Override
closeback to summary
public void close()

Implements org.jabref.logic.search.SearchBackend.close.

Doc from org.jabref.logic.search.SearchBackend.close.

Release backend resources (DB connections, Lucene index handles, …). Idempotent.

Annotations
@Override
createMetadataQueryback to summary
private static SearchQuery createMetadataQuery(SearchQuery query)
isEntryMatchedback to summary
public boolean isEntryMatched(BibEntry entry, SearchQuery query)

Implements org.jabref.logic.search.SearchBackend.isEntryMatched.

Doc from org.jabref.logic.search.SearchBackend.isEntryMatched.

Test a single entry against the query without re-running a full library search.

Annotations
@Override
rebuildFullTextIndexback to summary
public void rebuildFullTextIndex()

Implements org.jabref.logic.search.SearchBackend.rebuildFullTextIndex.

Doc from org.jabref.logic.search.SearchBackend.rebuildFullTextIndex.

Re-index linked-file fulltext from scratch. Backends without a fulltext index implement as a no-op.

Annotations
@Override
removeFromIndexback to summary
public void removeFromIndex(List<BibEntry> entries)

Implements org.jabref.logic.search.SearchBackend.removeFromIndex.

Annotations
@Override
searchback to summary
public SearchResults search(SearchQuery query)

Implements org.jabref.logic.search.SearchBackend.search.

Doc from org.jabref.logic.search.SearchBackend.search.

Run the query against this backend.

Annotations
@Override
updateEntryback to summary
public void updateEntry(FieldChangedEvent event)

Implements org.jabref.logic.search.SearchBackend.updateEntry.

Annotations
@Override