Verified Owner
Top Inners Fields Constructors Methods
org.jabref.logic.search.sqlbased

public Class IndexManager

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.file.DirectoryStream, .Files, .Path, java.util.ArrayList, .Comparator, .List, .Set, java.util.concurrent.Callable, .ConcurrentHashMap, .ExecutionException, .Future, java.util.concurrent.atomic.AtomicBoolean, java.util.stream.Stream, org.jabref.logic.preferences.CliPreferences, org.jabref.logic.search.LinkedFilesIndexManager, org.jabref.logic.search.sqlbased.indexing.BibFieldsIndexer, org.jabref.logic.search.sqlbased.retrieval.BibFieldsSearcher, org.jabref.logic.util.BackgroundTask, .DelayTaskThrottler, .Directories, .HeadlessExecutorService, .TaskExecutor, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.entry.event.FieldChangedEvent, org.jabref.model.entry.field.Field, org.jabref.model.search.SearchFlags, org.jabref.model.search.event.IndexAddedOrUpdatedEvent, .IndexClosedEvent, .IndexRemovedEvent, .IndexStartedEvent, org.jabref.model.search.query.SearchQuery, .SearchResults, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Field Summary

Modifier and TypeField and Description
private final BibFieldsIndexer
private final BibFieldsSearcher
private final AtomicBoolean
private final BibDatabaseContext
private final DelayTaskThrottler
private final LinkedFilesIndexManager
private static final Logger
private final ConcurrentHashMap<String, IndexManager.PendingFieldUpdates>
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
IndexManager(BibDatabaseContext databaseContext, TaskExecutor executor, CliPreferences preferences, PostgresServer postgresServer)

Method Summary

Modifier and TypeMethod and Description
public void
public static void
public void
public void
private void
closeThrottler(boolean waitForShutdown)

public boolean
public void
public void
public SearchResults
public void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bibFieldsIndexerback to summary
private final BibFieldsIndexer bibFieldsIndexer
bibFieldsSearcherback to summary
private final BibFieldsSearcher bibFieldsSearcher
closedback to summary
private final AtomicBoolean closed
databaseContextback to summary
private final BibDatabaseContext databaseContext
indexUpdateThrottlerback to summary
private final DelayTaskThrottler indexUpdateThrottler
linkedFilesIndexManagerback to summary
private final LinkedFilesIndexManager linkedFilesIndexManager
LOGGERback to summary
private static final Logger LOGGER
pendingFieldsByEntryback to summary
private final ConcurrentHashMap<String, IndexManager.PendingFieldUpdates> pendingFieldsByEntry
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

IndexManagerback to summary
public IndexManager(BibDatabaseContext databaseContext, TaskExecutor executor, CliPreferences preferences, PostgresServer postgresServer)

Method Detail

addToIndexback to summary
public void addToIndex(List<BibEntry> entries)
clearOldSearchIndicesback to summary
public static void clearOldSearchIndices()
closeback to summary
public void close()
closeAndWaitback to summary
public void closeAndWait()
closeThrottlerback to summary
private void closeThrottler(boolean waitForShutdown)
isEntryMatchedback to summary
public boolean isEntryMatched(BibEntry entry, SearchQuery query)

Implementation Note

No need to check for full-text searches as this method only used by the search groups

rebuildFullTextIndexback to summary
public void rebuildFullTextIndex()
removeFromIndexback to summary
public void removeFromIndex(List<BibEntry> entries)
searchback to summary
public SearchResults search(SearchQuery query)
updateEntryback to summary
public void updateEntry(FieldChangedEvent event)
updateOnStartback to summary
private void updateOnStart()
org.jabref.logic.search.sqlbased back to summary

private final Record IndexManager.PendingFieldUpdates

extends Record
Class Inheritance
Record Components
entry:BibEntry 
fields:Set<Field> 

Field Summary

Modifier and TypeField and Description
private final BibEntry
entry

Record Component accessed by entry().

private final Set<Field>
fields

Record Component accessed by fields().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public BibEntry
entry()

Record Component getter of entry.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public Set<Field>
fields()

Record Component getter of fields.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

entryback to summary
private final BibEntry entry

Record Component accessed by entry().

fieldsback to summary
private final Set<Field> fields

Record Component accessed by fields().

Constructor Detail

PendingFieldUpdatesback to summary
private PendingFieldUpdates(BibEntry entry, Set<Field> fields)

Method Detail

entryback to summary
public BibEntry entry()

Record Component getter of entry.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
fieldsback to summary
public Set<Field> fields()

Record Component getter of fields.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.