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

public Class InMemoryLibrarySearcher

extends Object
implements LibrarySearcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.search.LibrarySearcher
Imports
java.util.List, org.jabref.logic.search.LibrarySearcher, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .BibEntryPreferences, org.jabref.model.search.SearchFlags, org.jabref.model.search.query.SearchQuery, org.slf4j.Logger, .LoggerFactory

In-memory implementation of LibrarySearcher that evaluates the Search.g4 grammar directly against each BibEntry of the library. No external infrastructure required (no Postgres, no Lucene).

Limitation: linked-file content search (SearchFlags#FULLTEXT) is not supported. If a query carries the FULLTEXT flag, this implementation logs a warning and falls back to metadata-only matching.

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private final Character
private static final Logger

Constructor Summary

AccessConstructor and Description
public
InMemoryLibrarySearcher(BibDatabaseContext databaseContext, BibEntryPreferences bibEntryPreferences)

Method Summary

Modifier and TypeMethod and Description
public List<BibEntry>
public boolean
matches(BibEntry entry, SearchQuery query)

Test a single entry against a query without iterating the library.

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
keywordSeparatorback to summary
private final Character keywordSeparator
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

InMemoryLibrarySearcherback to summary
public InMemoryLibrarySearcher(BibDatabaseContext databaseContext, BibEntryPreferences bibEntryPreferences)

Method Detail

getMatchesback to summary
public List<BibEntry> getMatches(SearchQuery query)

Implements org.jabref.logic.search.LibrarySearcher.getMatches.

Annotations
@Override
matchesback to summary
public boolean matches(BibEntry entry, SearchQuery query)

Test a single entry against a query without iterating the library. Returns false for invalid queries.

matchesParsedQueryback to summary
private boolean matchesParsedQuery(BibEntry entry, SearchQuery query)